How would you recommend implementing providing a user with the choice of drag-n-drop or drag-n-copy?
Eg windows xp
Find the file or folder you want to move.
1 To move drag the file or folder to the destination.
2 To copy the item instead of moving it, press and hold down CTRL while dragging.
The small code modification will required to achieve such effect.
In dhtmlxtree.js you can locate next line
if (!this.callEvent(“onBeforeDrag”,[obj.id])) return null;
and replace it with
if (!this.callEvent(“onBeforeDrag”,[obj.id,(e||event)])) return null;
Now during tree’s init , the next code can be used
tree.attachEvent(“onBeforeDrag”,function(id,ev){
this.enableMercyDrag(ev.ctrlKey)
return true;
})
as result - if drag operation was started with ctrl-key pressed, tree will work in drag-as-copy mode.