Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Mar 07, 2007 10:44
open dhtmlx forum
Drag and drop is not working on the tree. Below is the code I used to enable drag and drop on the tree. ...

Drag and drop is not working on the tree. Below is the code I used to enable drag and drop on the tree.

                         tree=new dhtmlXTreeObject(document.getElementById('tree1'),"100%","100%",0);
                         tree.setImagePath("/resources/images/dhtmlXTree/");
                         tree.enableSmartXMLParsing(true);
                         tree.enableDragAndDrop(true);
                         tree.setOnClickHandler(tonclick);
                         tree.loadXML("/editTree/showleftXML.do",tonrender);        
                         tree.setDragHandler(tondrag);
                         tree.setDropHandler(tondrop);

The issue Iam encountering is the node is being dragged but not dropped. "tondrag" function is called but "tondrop" is not called and moreover the node is also not being physically.

I tried calling the setDragHandler and setDropHandler before loadXML method. But, still didn't work. Can you please look into the issue and let me know if there are any changes to be done to the way Iam calling the event handlers ?
Answer posted on Mar 07, 2007 10:45

The onDrag and onDrop events can be defined at any time.

Please be sure that you’re returning "true" from your onDrag handler, returning any other value, or not returning any values at all can block drag-n-drop ( in such case onDrop will not be called, because drag-n-drop ignored ).
Answer posted by Embre (Support) on Nov 29, 2014 07:52

The information connected with gantchart and touch mobile applications also can help you, so please check it too.