1. #1
    Ext JS Premium Member
    Join Date
    Feb 2008
    Posts
    51
    Vote Rating
    0
    noamway is on a distinguished road

      0  

    Default Answered: get the new 'parentNode' when using 'treeviewdragdrop'

    Answered: get the new 'parentNode' when using 'treeviewdragdrop'


    If a user is drag a node to a folder (parent) I try to get is new parent ID with the event 'DROP'.
    The problem is that if the folder is not render I'm getting from:
    node.parentNode.internalId
    The main root of the tree.

    But if I'm using "setTimeout" I'm getting is new parent ID.

    This is what I have now, and I don't want to use the 'timeout', what option do I have:
    Code:
                    listeners: {
    					'drop': {fn:function( node, data, overModel, dropPosition, eOpts ){
    						var moveID ;
    						var movePreviousSibling ;
    						var moveNextSibling ;
    						var moveParentNode ;
    
    						node = data.records[0];
    
    						if (node)
    							moveID					= node.internalId ;
    
    						//Disable all the tree
    						Ext.getCmp('treePagesList').disable();
    
    						setTimeout(function(){
    							//Get all the detail of is new position
    							node = Ext.getCmp('treePagesList').getStore().getNodeById(moveID);
    
    							if (node.previousSibling)
    								movePreviousSibling		= node.previousSibling.internalId ;
    
    							if (node.nextSibling)
    								moveNextSibling			= node.nextSibling.internalId ;
    
    							if (node.parentNode)
    								moveParentNode			= node.parentNode.internalId ;
    
    						}, 500);
    
    					}, scope:this}
                    }

  2. You could modify the Ext.tree.ViewDropZone class (source). There you have a function named: handleNodeDrop

    When the function finished adding the new node, you could fire an event:

    Code:
    view.fireEvent('afternodedrop', node);
    I made my own treeviewdragdrop plugin for that. It's the same plugin, it just uses my modified version of Ext.tree.ViewDropZone.

  3. #2
    Ext JS Premium Member
    Join Date
    Feb 2008
    Posts
    51
    Vote Rating
    0
    noamway is on a distinguished road

      0  

    Default


    Can someone can help me here please?
    I really like to know if there is any option do use more event like 'drop' that working Better.

  4. #3
    Sencha User Arg0n's Avatar
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    122
    Answers
    12
    Vote Rating
    16
    Arg0n will become famous soon enough Arg0n will become famous soon enough

      0  

    Default


    You could modify the Ext.tree.ViewDropZone class (source). There you have a function named: handleNodeDrop

    When the function finished adding the new node, you could fire an event:

    Code:
    view.fireEvent('afternodedrop', node);
    I made my own treeviewdragdrop plugin for that. It's the same plugin, it just uses my modified version of Ext.tree.ViewDropZone.

  5. #4
    Ext JS Premium Member
    Join Date
    Feb 2008
    Posts
    51
    Vote Rating
    0
    noamway is on a distinguished road

      0  

    Default


    You're great. Big thanks :-)

Thread Participants: 1

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