Hybrid View

  1. #1
    Sencha User
    Join Date
    Dec 2007
    Posts
    57
    Vote Rating
    1
    MickeyMiner is on a distinguished road

      0  

    Default Unanswered: DnD: Detect model in TreeGrid where mouse currently moves over

    Unanswered: DnD: Detect model in TreeGrid where mouse currently moves over


    Hi,

    In a TreeGrid I would like to enable or disable nodes of the tree depending on their properties.
    How do I detect the model in the tree where my mouse currently moves over?

    Thanx,

    mm

    Code:
    TreeGridDropTarget<MyModel> target = new TreeGridDropTarget<MyModel>(grid);
            target.setAllowSelfAsSource(true);
            target.setAllowDropOnLeaf(false);
            target.setFeedback(DND.Feedback.BOTH);
            target.addDragMoveHandler(new DndDragMoveHandler() {
                @Override
                public void onDragMove(DndDragMoveEvent event) {
                    MyModel m = .......  // TO DO please add code here
                    Info.display("onDragMove()", m.toString());
                    if (m.acceptsDrops()) {
                        event.getStatusProxy().setStatus(true);
                    } else {
                        event.getStatusProxy().setStatus(false);
                    }
                }
            });

  2. #2
    Sencha User
    Join Date
    Dec 2007
    Posts
    57
    Vote Rating
    1
    MickeyMiner is on a distinguished road

      0  

    Default


    Hi,

    This solution works... but only partially...
    If I drag an object between two nodes, the object can dropped over there... But I would like to prohibit dropping objects elsewhere but on a specific folder (setAllowDropOnLeaf() is not good enough)...

    m.

    Code:
    TreeGridDropTarget<MyModel> target = new TreeGridDropTarget<MyModel>(grid);
    target.setAllowSelfAsSource(true);         
    target.setAllowDropOnLeaf(false);
    target.setFeedback(DND.Feedback.BOTH);
    target.addDragMoveHandler(new DndDragMoveHandler() {
        @Override
        public void onDragMove(DndDragMoveEvent event) {
           DragMoveEvent e = event.getDragMoveEvent();
           NativeEvent n = e.getNativeEvent();
           EventTarget et = n.getEventTarget();
           Element itemMovedOverElement = (Element) et.cast();
           MyModel m = grid.findNode(itemMovedOverElement).getModel();
           Info.display("onDragMove()", m.toString());                 
           if (m.acceptsDrops()) {
              event.getStatusProxy().setStatus(true);
           } else {
              event.getStatusProxy().setStatus(false);                 
           }
       }  
    });

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi