Skip to main content

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 item
  • index: number - defines the position of the item in the component
  • parent: string - the ID of the future parent item

Returns:

The item's id or an array with ids of items.

Example

myToolbar.data.add({    type:"button",    icon:"dxi-plus",    value:"New"},1);