Check documentation for the latest version of dhtmlxSuite copy DHTMLX Docs

copy

creates a copy of an item

void copy(string|number sid, [number tindex,object tobj,string|number tid] );
sidstring|numberid of the source item, mandatory
tindexnumbertarget index, optional
tobjobjecttarget object (target list), optional
tidstring|numberid which will be assigned to a newly created item, optional

Example

// make a copy of an element
var new_id = myList.copy(source_id);
// make a copy at the specific position
var new_id = myList.copy(source_id, index);
// make a copy in the different view
var new_id = myList.copy(source_id, index, some_other_view);
   //or
var new_id = myList.copy(source_id, null , some_other_view);
 
// make a copy by the defined ID
myList.copy(source_id, null, null, target_id);
   //or
myList.copy(source_id, index, null, target_id);
   //or
myList.copy(source_id, index, some_other_view, target_id);

Back to top