Dont lose existing values
This commit is contained in:
parent
a7f797e27f
commit
a94266d0c6
@ -52,7 +52,11 @@ export class CustomFieldsBulkEditDialogComponent {
|
|||||||
) {}
|
) {}
|
||||||
|
|
||||||
initForm() {
|
initForm() {
|
||||||
this.form = new FormGroup({})
|
Object.keys(this.form.controls).forEach((key) => {
|
||||||
|
if (!this._fieldsToAddIds.includes(parseInt(key))) {
|
||||||
|
this.form.removeControl(key)
|
||||||
|
}
|
||||||
|
})
|
||||||
this._fieldsToAddIds.forEach((field_id) => {
|
this._fieldsToAddIds.forEach((field_id) => {
|
||||||
this.form.addControl(field_id.toString(), new FormControl(null))
|
this.form.addControl(field_id.toString(), new FormControl(null))
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user