Categories | Question details Back To List | ||
onDrag called on moveItem! dhtmlxTree v.2.1 Professional edition build 90226 Hi, I'm using the following; . . . tree.enableHighlighting(true); tree.enableDragAndDrop(true,true); tree.setDragHandler("onDrop"); tree.setDragBehavior("complex"); tree.attachEvent("onDrop", function(sId,tId,id,sObject,tObject){}); . . . function onDrop(sId,tId,id,sObject,tObject) { var myID = tree.getSelectedItemId(); editSite(id,myID,"move"); return true; } but everytime I add a new node and execute; tree.insertNewNext(sID,newID,label,0,0,0,0,""); tree.moveItem(newID,"up"); onDrop appears to fire, is there anyway I can avoid this? Answer posted by Stanislav (support) on Nov 10, 2009 01:47 both onDrag and onDrop events are executed for the moveItem command, there is no way to disable such behavior, but you can use flags to ignore not necessary calls. tree.insertNewNext(sID,newID,label,0,0,0,0,""); tree._ignore_call = true; tree.moveItem(newID,"up"); tree._ignore_call = false; tree.attachEvent("onDrop", function(sId,tId,id,sObject,tObject){ if (this._ignore_call) return true; ... }); |