Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 1018 Bytes

File metadata and controls

26 lines (18 loc) · 1018 Bytes
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.

copy()

@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 copy
  • index: number - the index to create a copy at
  • target?: 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