PDA

View Full Version : Select node after drag and drop



funwithextjs
7 Jan 2011, 11:18 AM
Hi I am trying select the node (the one selected before move node action) after the node is moved. Iam using the following code. Whats wrong with this code, i am getting error ui is null or undefined. 'movenode': function(tree,node,oldParent,newParent,index){ var myPath = node.getPath(); var id = node.id; var treeloader = Ext.getCmp('tree-panel'); Ext.Ajax.request({ url:reqString, // Ajax Request }); treeloader.getRootNode().reload(function(callback) { treeloader.expandPath(myPath, null, function(){ treeloader.getSelectionModel().select(treeloader.getNodeById(id)); }); }); } Thanks

10 Jan 2011, 6:19 AM
Hi I am trying select the node (the one selected before move node action) after the node is moved. Iam using the following code. Whats wrong with this code, i am getting error ui is null or undefined. 'movenode': function(tree,node,oldParent,newParent,index){ var myPath = node.getPath(); var id = node.id; var treeloader = Ext.getCmp('tree-panel'); Ext.Ajax.request({ url:reqString, // Ajax Request }); treeloader.getRootNode().reload(function(callback) { treeloader.expandPath(myPath, null, function(){ treeloader.getSelectionModel().select(treeloader.getNodeById(id)); }); }); } Thanks

Please post properly formatted code in the future! The above code is not helpful at all in helping you.


That said, are you using the out of the box drag and drop or are you writing your own overrides?

funwithextjs
10 Jan 2011, 6:25 AM
I am not overriding my own methods, just added listener 'movenode' and sending Ajax request back to the server.