有谁做过extjs有复选框的动态树

http://chemzqm.iteye.com/blog/632970 这个是ext的tree级联

你是想要级联吗?

这样的话就没什么了 看下面我的小例子
[code="java"] <br> Ext.onReady(function(){</p> <pre><code>var tree = new Ext.tree.TreePanel({ el: &#39;tree&#39;, loader: new Ext.tree.TreeLoader() }); </code></pre> <p>var menu = new Ext.menu.Menu({ <br> id:&#39;contentMenu&#39;, <br> items:[{text:&#39;我被单击啦&#39;,handler:function(){alert(&#39;我被单击啦。。啊&#39;);}}] <br> }); <br> var root = new Ext.tree.AsyncTreeNode({<br> text:&#39;根&#39;,<br> checked: false,<br> id:&quot;root&quot;,<br> children: [<br> {text: &#39;Leaf No. 1&#39;,id:&quot;root1&quot;,checked: false,leaf: false,children: [<br> {text: &#39;Leaf No. 11&#39;,id:&quot;root11&quot;,leaf: true,checked: false},<br> {text: &#39;Leaf No. 12&#39;,id:&quot;root12&quot;,leaf: true,checked: false}<br> ]},<br> {text: &#39;Leaf No. 2&#39;,leaf: true,id:&quot;root2&quot;, checked: false}<br> ]<br> });<br> //将menu菜单绑定到该树上 <br> tree.on(&#39;contextmenu&#39;,function(node,e){ <br> e.preventDefault();//阻止浏览器默认右键菜单 <br> node.select();//是该节点被选中状态 <br> menu.showAt(e.getXY());<br> });//获得鼠标的坐标 <br> tree.setRootNode(root);<br> tree.render();</p> <pre><code>root.expand(); </code></pre> <p>});<br>




复选框就是加个 checked: false或者true