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 copyindex: number
- the position of a copytarget: TreeCollection
- a data collection where the copy will be storedtargetId: 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 toolbar
toolbar2.data.copy("save_btn",1,toolbar1.data);