drag and drop between trees

Talk about add-ons and extension development.
Post Reply
poleta33
Posts: 120
Joined: October 14th, 2004, 2:06 pm

drag and drop between trees

Post by poleta33 »

Hi

I can't find the solution to this problem : I want to know on which item of my tree, the content of event.dataTransfer.getData("text/plain") will be dropped during a drag & drop operation...


++
poleta33
Posts: 120
Joined: October 14th, 2004, 2:06 pm

Re: drag and drop between trees

Post by poleta33 »

got it :

Code: Select all

   
      stopDrag: function (aEvent) {
         var myTree = document.getElementById('dirTree');
         // get the row, col and child element at the point
         var row = { }, col = { }, child = { };
         myTree.treeBoxObject.getCellAt(aEvent.clientX, aEvent.clientY, row, col, child);
         var cellText = myTree.view.getCellText(row.value, col.value);

         var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
         var errorTitle = "stopDrag";
         prompts.alert(null, errorTitle, cellText);
      },
Post Reply