我们使用TreePanel中我们application.The代码:ExtJS4 TreePanel中图标的问题
var exStore = Ext.create('Ext.data.TreeStore',{
root : {
children : [{
text : 'Parent 1',
id : 'parent1',
checked : false,
iconCls : 'ico1',
children : [{
text : 'Child 1',
id : 'child1',
checked : false,
leaf : true
},{
text : 'Child 2',
id : 'child2',
checked : false,
leaf : true
}]
},{
text : 'Parent 2',
id : 'parent2',
checked : false,
iconCls : 'ico2',
children :[{
text : 'Child 3',
id : 'child3',
checked : false,
leaf : true
},{
text : 'Child 4',
id : 'child4',
checked : false,
leaf : true
}]
}]
}
});
var treepanel = Ext.create('Ext.tree.Panel',{
id : 'tree',
width : 300,
height : 300,
store : exStore,
rootVisible : false
});
但是我们在这里面临的两个问题。
1.我们为父节点指定了iconCls,当树折叠时显示效果很好。如果我们展开树,它会被文件夹图标替换。有关参考请查看附加图像。
2.如果我们选择父节点,那么必须选择特定父节点下的子节点。
如果任何人有idea.Please帮助me.We试图对这些问题很多。
请注意,这会改变您应用中的所有树木。 – dbrin