| sidebar_label | copy() |
|---|---|
| title | JavaScript DataCollection - copy Method |
| description | You can explore the copy method of DataCollection in the documentation of the DHTMLX JavaScript UI library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Suite. |
@short: creates a copy of an item at the defined position
@signature: {'copy(id: (string | number) | (string | number)[], index: number, target?: object): (string | number) | (string | number)[];'}
@params:
id: (string | number) | (string | number)[]- the id of an item or an array with ids of items 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
@descr:
Related sample: Data. Copy