Skip to main content

copy()

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

copy(id: Id | Id[], index: number, target?: ITreeCollection, targetId?: Id): Id | Id[];

Parameters:

  • id: string | string[] - the ids of the items to copy
  • index: number - the position of a copy
  • target: TreeCollection - a data collection where the copy will be stored
  • targetId: string - (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 toolbartoolbar2.data.copy("save_btn",1,toolbar1.data);