makes a copy of an item

number copy(id sid,number tindex, [object tobj,object details] );
sididthe ID of a source item
tindexnumberthe index a copy will be created at
tobjobjectoptional, the target view
detailsobjectoptional, extra parameters for moving
numberthe auto-generated id of the created copy

The details object can contain the following properties:

details = {};
details.newId = "123"; // a new id for the moved item
details.parent = "a2"; // the id of a new parent element

If the parent is defined, tindex will be the child index inside the target branch.

If parent is not defined, the value will be set to 0 (will be added to the tree root).

In case newId is not defined, the new ID will be the same as the ID of the source item (sid), which is not desirable while copying takes place within one and the same component.

Back to top
If you have not checked yet, be sure to visit site of our main product Webix ui library and page of javascript tree control product.