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

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