add()
adds an item to a component
add(obj: IDataItem | IDataItem[], index?: number, parent?: Id): Id | Id[];
Parameters:
obj: object | array
- the configuration of the added itemindex: number
- defines the position of the item in the componentparent: string
- 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);