EXT~~点击父节点生成子节点的动态树

一个点击父节点生成子节点的动态树~~~捣鼓了一天~~终于做好了~~把源码贴出来~~备忘~~~
<script type="text/javascript">  
Ext.onReady(function(){
Ext.BLANK_IMAGE_URL = "/PsoWeb/s_sgd/ext/resources/images/default/s.gif"
var Tree = Ext.tree;
var root=new Ext.tree.AsyncTreeNode({
id:"para=root",
text:"基本维度
});
var tree=new Tree.TreePanel({
renderTo:"tree-div",
root:root,
useArrows:true,  
    autoScroll:true,  
    animate:true,  
    enableDD:true,  
    containerScroll: true,
loader: new Ext.tree.TreeLoader({url:"treejsoncallback.jsp?para=root"})
});
tree.on("beforeload",function(node,event){
tree.loader.dataUrl='treejsoncallback.jsp?'+node.id;
});
});
</script>


嵌入到div中~~
<body>  
<div id="tree-div" style="overflow:auto; height:600px;width:250px;border:1px solid #c3daf9;"></div>        
</body>

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