Extjs如何实现单击展开Tree的子节点 5
用了singleClickExpand:true,不行啊用了listeners:{"click":function(node,e){if(node.expanded==f...
用了singleClickExpand: true,不行啊
用了listeners: {
"click": function(node, e) {
if (node.expanded == false) {
node.expand();
}
else {
node.collapse();
}
}
},
也不行啊!郁闷了!
我的代码如下:
var callMenu = new Ext.TreePanel(
{
border: false,
rootVisible: false,
useArrows: true,
root: {
expanded: true,
children: [{
expanded: true,
text: "行政科室",
children: [
{ text: "科室1", leaf: true },
{ text: "科室2", leaf: true },
{ text: "科室3", leaf: true },
{ text: "科室4", leaf: true },
{ text: "科室5", leaf: true },
{ text: "科室6", leaf: true },
{ text: "科室7", leaf: true },
{ text: "科室8", leaf: true },
{ text: "科室9", leaf: true },
{ text: "科室10", leaf: true}]
}, {
expanded: true,
text: "医技科室",
children: [
{ text: "科室1", leaf: true },
{ text: "科室2", leaf: true },
{ text: "科室3", leaf: true },
{ text: "科室4", leaf: true },
{ text: "科室5", leaf: true },
{ text: "科室6", leaf: true },
{ text: "科室7", leaf: true },
{ text: "科室8", leaf: true },
{ text: "科室9", leaf: true },
{ text: "科室10", leaf: true}]
}
]
}
});
我用的是4.0的库,一切正常就是不能实现单击展开树,求解 展开
用了listeners: {
"click": function(node, e) {
if (node.expanded == false) {
node.expand();
}
else {
node.collapse();
}
}
},
也不行啊!郁闷了!
我的代码如下:
var callMenu = new Ext.TreePanel(
{
border: false,
rootVisible: false,
useArrows: true,
root: {
expanded: true,
children: [{
expanded: true,
text: "行政科室",
children: [
{ text: "科室1", leaf: true },
{ text: "科室2", leaf: true },
{ text: "科室3", leaf: true },
{ text: "科室4", leaf: true },
{ text: "科室5", leaf: true },
{ text: "科室6", leaf: true },
{ text: "科室7", leaf: true },
{ text: "科室8", leaf: true },
{ text: "科室9", leaf: true },
{ text: "科室10", leaf: true}]
}, {
expanded: true,
text: "医技科室",
children: [
{ text: "科室1", leaf: true },
{ text: "科室2", leaf: true },
{ text: "科室3", leaf: true },
{ text: "科室4", leaf: true },
{ text: "科室5", leaf: true },
{ text: "科室6", leaf: true },
{ text: "科室7", leaf: true },
{ text: "科室8", leaf: true },
{ text: "科室9", leaf: true },
{ text: "科室10", leaf: true}]
}
]
}
});
我用的是4.0的库,一切正常就是不能实现单击展开树,求解 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询