1. #1
    Ext User fother's Avatar
    Join Date
    Sep 2007
    Location
    Brazil
    Posts
    744
    Vote Rating
    -1
    fother is an unknown quantity at this point

      0  

    Default cancel drop event

    cancel drop event


    I select one item and drag.. but when I will drop I need validate if can...

    If I use e.doit = false, but don't work.. any suggest?

    Code:
        final TreeDragSource source = new TreeDragSource(binder);
        source.addDNDListener(new DNDListener() {
          @Override
          public void dragStart(DNDEvent e) {
        	  
            TreeItem item = tree.findItem(e.getTarget());
            item.setLeaf(true);
            if (item != null && item == tree.getRootItem().getItem(0) && tree.getRootItem().getItemCount() == 1) {
              e.doit = false;
              e.status.setStatus(false);
              return;
            }
            super.dragStart(e);
        	  
          }
          
          @Override
        	public void dragDrop(DNDEvent e) {
        	  e.doit = false;
              e.status.setStatus(false);
        	}
        });

  2. #2
    Ext User
    Join Date
    Nov 2008
    Posts
    19
    Vote Rating
    0
    shermdog01 is on a distinguished road

      0  

    Default


    I'm doing something similar to this but am using dragEnter on the target.

    Here is an example from my app which prevents a duplicate item from being dropped into my list. (It's been sanitized a bit..)

    Code:
    myTarget.addDNDListener(new DNDListener() { 
          public void dragEnter(DNDEvent e) {
              e.doit = false;
              //Prevent duplicate entries
              if (myList.getItemCount() > 0){
                    ModelData smd = view.getSelectionModel().getSelectedItem();
                    for(int i = 0; i < myList.getItemCount(); i++){
                       ModelData md = myStore.getAt(i);
                       if(smd.get("Id").equals(md.get("Id"))){
                           System.out.println("Match!");
                           //break;
                           return;
                       }
                    }
              } else {
                  e.doit = true;
              }
              e.doit = true;
          }
    });

  3. #3
    Ext User fother's Avatar
    Join Date
    Sep 2007
    Location
    Brazil
    Posts
    744
    Vote Rating
    -1
    fother is an unknown quantity at this point

      0  

    Default


    thanks for your reply.. but don't work for me..

    Code:
        final TreeDropTarget target = new TreeDropTarget(binder);
        target.setAllowSelfAsSource(true);
        target.setFeedback(Feedback.BOTH);
        target.setAutoExpand(false);
        
        target.addDNDListener(new DNDListener() {
    
            @Override
        	public void dragEnter(DNDEvent e) {
        	  e.doit = false;
              e.status.setStatus(false);
        	}
        });

  4. #4
    Ext User fother's Avatar
    Join Date
    Sep 2007
    Location
    Brazil
    Posts
    744
    Vote Rating
    -1
    fother is an unknown quantity at this point

      0  

    Default


    I need for example that in this example http://www.extjs.com/explorer/#reorderingtree I can't add items in "Misc" item.

  5. #5
    Ext User fother's Avatar
    Join Date
    Sep 2007
    Location
    Brazil
    Posts
    744
    Vote Rating
    -1
    fother is an unknown quantity at this point

      0  

    Wink


    this method is called when the cursor pass into a node..

    Code:
    		final TreeDropTarget target = new TreeDropTarget(binder) {
    
    			@Override
    			protected void handleAppend(DNDEvent event, TreeItem item) {
    
    					boolean test = false;
    					if (test) {
    
    						super.handleAppend(event, item);
    					} else {
    						event.doit = false;
    						event.status.setStatus(false);
    						return;
    					}
    		
    			}
    
    		};

  6. #6
    Sencha User
    Join Date
    Dec 2007
    Posts
    3
    Vote Rating
    0
    martyphee is on a distinguished road

      0  

    Default


    I'm looking for a way to do this also. How can I prompt a user for a confirmation and if they select No stop the DND event. Where should this be done. I haven't been able to find the correct location to do this.

Thread Participants: 2

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