adds an item to the form
pId | string|number | the parent item's id, i.e. the id of the existing item you want to nest a new item into |
itemData | object | the object of a new item |
pos | number | the position that the new item will be added to |
insertAfter | number | the position of the item after which a new item will be inserted |
// to add as an individual item
myForm.addItem(null, itemData, pos, insertAfter);
// to nest into some existing item
myForm.addItem(pId, itemData, pos, insertAfter);
if you don't want to specify the parent item, set the pId parameter to "null".
For radio buttons you must specify the pId parameter as an array with 2 elements:
If any columns are used, a new item will be inserted into the column where item[pos] positioned, before it. "insertAfter" specifies that a new item will be inserted after item[pos], to add the possibility to make a new item the last in the column. This param is ignored when inserting a new column.
Back to top