add()
adds an item to a component
add(obj: object | object[], index?: number, parent?: string | number): (string | number) | (string | number)[];
Parameters:
obj: object | array
- the configuration of the added itemindex: number
- defines the position of the item in the componentparent: string | number
- the ID of the future parent item
Returns:
The item's id or an array with ids of items.
Example
toolbar.data.add({
type:"button",
icon:"dxi-plus",
value:"New"
},1);