1. #1
    Sencha User
    Join Date
    Feb 2013
    Posts
    1
    Vote Rating
    0
    fvaliquette is on a distinguished road

      0  

    Default Unanswered: Dragging and dropping nodes only withing the same parents.

    Unanswered: Dragging and dropping nodes only withing the same parents.


    Hello,

    I found on this forum an old post showing how to allow drag and drop only within same parent but it is from version 2.X.
    http://www.sencha.com/forum/showthre...in-parent-only

    I was wondering if in version 3.4, there was a more elegant way to do it.

    Exemple :
    Node1
    Node1.1
    Node1.2

    Node2
    Node2.1
    Node2.2

    I would like to allow changing the order of the children of Node1 and Node 2 with drang and drop, but I want to disable draging children of Node2 in Node1.

    Thank you

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Posts
    1
    Vote Rating
    0
    H.Kamioka is on a distinguished road

      0  

    Default


    Hi fvaliquette,


    I had same problem. I wrote custom TreeDropTarget to prevent insert action.


    Code:
    public class CustomTreeDropTarget<M> extends TreeDropTarget<M> {
    
    
    	public CustomTreeDropTarget(Tree<M, ?> tree) {
    		super(tree);
    	}
    
    
    	@Override
    	protected void handleInsert(DndDragMoveEvent event, final TreeNode<M> item) {
    
    
    		if (item.getModel().equals(root)) {
    
    
    			if (activeItem != null) {
    				clearStyle(activeItem);
    			}
    			status = -1;
    			activeItem = null;
    			appendItem = null;
    
    
    			Insert.get().hide();
    			event.getStatusProxy().setStatus(false);
    
    
    		} else {
    			super.handleInsert(event, item);
    		}
    	}
    }

Thread Participants: 1

Tags for this Thread

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