我們使用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