如何添加复选框到Ext.tree.TreePanel? [英] How to add checkboxes to Ext.tree.TreePanel?
本文介绍了如何添加复选框到Ext.tree.TreePanel?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建了这个简单的树:
I created this simple tree:
var children = [{
text:'My Layers',
children:[
new Ext.tree.TreeNode({text:'test1',leaf:true}),
new Ext.tree.TreeNode({text:'test2',leaf:true})
]
}];
var tree = new Ext.tree.TreePanel({
loader:new Ext.tree.TreeLoader(),
width:150,
title:'Layers',
height:250,
collapsible:true,
rootVisible:false,
root: new Ext.tree.AsyncTreeNode({
expanded:true,
leaf:false,
text:'Tree Root',
children:children
})
});
如何向每个节点添加复选框?
How can I add a Checkbox to each node?
实际上,我将传递列表作为JSON数组中的函数的参数(例如[test1,test2])。从JSON数据加载节点的正确方法是什么?
Actually I'm gonna pass the list as a parameter to the function in a JSON array (e.g. ["test1","test2"]). What is the proper way to load nodes from JSON data?
我使用ExtEs 2.3和GeoExt。
I'm using ExtJs 2.3 with GeoExt.
干杯!
推荐答案
http://dev.sencha.com/deploy/dev/examples/tree/check-tree.html
EXTJS库有一个例子。
The EXTJS library has an example of just that.
这篇关于如何添加复选框到Ext.tree.TreePanel?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文