Skip to main content

copy()

adds a copy of an item and places it in the specified position

copy(id: (string | number) | (string | number)[], index: number, target?: object, targetId?: string | number): (string | number) | (string | number)[];

Parameters:

  • id: (string | number) | (string | number)[] - the ids of the items to copy
  • index: number - the position of a copy
  • target: object - a tree collection where the copy will be stored
  • targetId: string | number - (for menu options) the ID of a menuItem to which a copy of the menu option will be placed

Returns:

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

Example

toolbar.data.copy("print_btn",2)
// another toolbar
toolbar2.data.copy("save_btn",1,toolbar1.data);