1. #1
    Sencha User
    Join Date
    Jan 2010
    Posts
    11
    Vote Rating
    0
    chazzz2473 is on a distinguished road

      0  

    Default Get dragged item in DNDListener

    Get dragged item in DNDListener


    Hello, I am currently trying to get the drag & drop to work with two of my TreePanels... so far everything is OK, the only thing I don't get is : How can I acces my dragged object in the dragDrop overrided function (through the e object) ?

    I tried the getSource() and getData() functions, but no succes.
    Here is the code I use :

    Code:
    DNDListener listener = new DNDListener() {              
                public void dragDrop(DNDEvent e) {
                     // how to get my tree node ?
                }
    }
    Any help would be great !

  2. #2
    Sencha User
    Join Date
    Jan 2010
    Posts
    11
    Vote Rating
    0
    chazzz2473 is on a distinguished road

      0  

    Default


    I just found a way to do what I wanted :

    I overrided the dragStart to save the item like this :

    Code:
    TreePanel tree = (TreePanel) e.getComponent();  
    draggedItem = tree.getSelectionModel().getSelectedItem();
    then I can use it in the dragDrop method.

    I Still have one problem though, what if (depending on the objects in my tree) I decide not to allow the drop ? how can I "cancel" the drop in the dragDrop method ?

    neither e.setCancelled(true); nor e.stopEvent(); nor e.getStatus().setStatus(false); did work...

    Thanks a lot !

Similar Threads

  1. how to cuztomize the dragged item during drag&drop in a tree ?
    By lebesnec in forum Ext 3.x: Help & Discussion
    Replies: 7
    Last Post: 14 Jan 2011, 10:00 AM
  2. Replies: 0
    Last Post: 24 Aug 2010, 11:54 AM
  3. TreePanel , getting dragged item
    By velk in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 9 Apr 2010, 5:28 AM
  4. Portlet goes on top of window when dragged
    By thejoker101 in forum Ext GWT: Discussion
    Replies: 5
    Last Post: 14 Aug 2009, 11:47 AM
  5. missing javadoc in DNDListener
    By fother in forum Ext GWT: Bugs (1.x)
    Replies: 1
    Last Post: 25 Feb 2009, 3:50 AM

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar