copy()
creates a copy of an item at the defined position
copy(id: Id | Id[], index: number, target?: IDataCollection): Id | Id[];
Parameters:
id: string | string[]
- the id of an item to copyindex: number
- the index to create a copy attarget: object
- optional, the target data collection object
Returns:
The item's id or an array with ids of items.
Example
component.data.copy("4",5); // copies the item with id:4 to the position with index 5
Related sample: Data. Copy