Ext 的Tree型结构

动态树,当我选择一个节点并在该节点下增加节点,如何在该树控件reload后定位到当前选择的节点

代码如下

Ext.onReady(
      function(){
      
      
       var root = new Ext.tree.AsyncTreeNode(
   {
  text:"菜单根节点",
  expanded:true,
  id:'root'
   });
   var tree = new Ext.tree.TreePanel({
    loader:new Ext.tree.TreeLoader({
     baseAttrs:{
     cust:'client'
     },
     dataUrl:'datatest.jsp'
    }),
    listeners : {
'click' : function(node, event) {
if (node.id == 'aa') {
getcount();
}

tree.getNodeById("aa").select();
},
'load':function(node, event) {
    var a = tree.getNodeById("aa");
if (a!=null) {
a.select();
//alert('11111222654789');
}
}
},
   title:'Tree示例',
   width:200,
   height:500,
   autoHeight:true,
  
   applyTo:'tree-div',
   root:root
 
  });
    tree.on('load', function(node, event)
    {
       var a = tree.getNodeById("aa");
   if (a!=null) {
a.select();
//alert('qqqqqqqqqqq');
  }
   }); 
 
       });

你可能感兴趣的:(jsp,ext)