0

I am trying append child nodes to a tree node when the node is clicked. It is required to fire a tree loader with desired url whenever a particular node is clicked.

I tried something like this

tree.dataUrl = '/zport/clusterSysReg?args=/directory/'+node.attributes.name;
//alert(tree.dataUrl);
node.reload();

whenever I click on a node the child nodes are created but not with the new url, but with the old url, I also tried node.load instead of node.reload(), but I am getting an error .........

Any idea how to proceed

Anurag Sharma
  • 4,839
  • 13
  • 59
  • 101
  • you can use TreeLoader's baseParams property. so, on every selection change you set args parameter as you want and you don't have to re-set the url everytime. – ncank Jul 11 '12 at 22:55

1 Answers1

0

Here is the solution to the above problem (took me whole day to solve this) Inside the listner function added the following lines

listeners: {
   'render': function(tp){

            tp.getSelectionModel().on('selectionchange', function(tree, node){

            tp.getLoader().dataUrl = '/zport/clusterSysReg?args='+node.attributes.name;
            tp.getLoader().load(node);
            ...................... 
            ......................
            }
}
Anurag Sharma
  • 4,839
  • 13
  • 59
  • 101