DHTMLX Docs & Samples Explorer

copy (sid, tindex, tobj, tid)

Required library edition: This method works with any edition of DHTMLX library
Required library file: datastore_debug.js

Creates a copy of the item.

  //make a copy of the element
var new_id = data.copy(source_id);
  //make a copy at the specific position
var new_id = data.copy(source_id, index);
  //make a copy to a different datastore
var new_id = data.copy(source_id, index, some_other_datastore);
 //or
var new_id = data.copy(source_id, null , some_other_datastore);
 
  //make a copy with defined ID
data.copy(source_id, null, null, target_id);
  //or
data.copy(source_id, index, null, target_id);
  //or
data.copy(source_id, index, some_other_view, target_id);

Parameters:

  • sid - the id of the source item, mandatory
  • tindex - the target index, optional
  • tobj - the target object ( target DataStore ), optional
  • tid - the id which will be assinged to newly created item, optional