0

I have a form (dxForm) with several fields and I want to add new fields at the runtime. So I want to find an item of the type of "group" and add to it a collection of items of type "simple" where I can build custom fields from the JSON, Label, Value, EditoType, etc.

Thanks in advance

Tom Brzeski
  • 501
  • 1
  • 5
  • 9

1 Answers1

0

Use the JavaScript push method to add an item to a dxForm collection. For example:

<dx-form [formData]="customer" [items]="formItems"></dx-form>

addItem() {
    this.formItems.push({
      itemType: 'group',
      caption: 'Customer',
      colCount: 3,
      items: ['firstName', 'lastName', 'age']
    });
 }
Marion
  • 1,074
  • 5
  • 10