Drag and drop icon triggers event?

I’m dragging on icon on to a tree to indicate the addition of a new file. The icon is external to the tree. The icon drops into the tree just fine and shows as an icon in the tree but without itemText. What I’d like to do is have this trigger an event, so that I can prompt the user for a file name at the point of dropping the icon. At the moment I have to wait for the user to click on the icon and use the onClick event to detect there is no itemText and so trigger a request for content.

I have an onDrag handler set up - and this triggers fine when dragging existing nodes around. But it is not triggered by the addition of an icon dragged from outside the tree.


You can use makeDragable in this case:

var item_text = prompt(“Please enter item text”);

Please, see sample in the tree package dhtmlxTree/samples/05_drag_n_drop/01_drag_in_simple.html