详细实现可参考ext官方示例的xml-tree-loader示例。
分两步:
1 在css中定义一个类样式如
.abc{
background-image: url(../shared/icons/fam/user.gif) !important;
}
//加入 !important 是为了将这个样式的优先级调高。
2 在定义树节点时,将iconCls属性值指定为上面定义的类样式abc。如:
[{
text: '目录',
cls: 'folder',
children: [{
text: '叶节点',
leaf: true,
checked: false,
iconCls:'abc'
},{……
……
分两步:
1 在css中定义一个类样式如
.abc{
background-image: url(../shared/icons/fam/user.gif) !important;
}
//加入 !important 是为了将这个样式的优先级调高。
2 在定义树节点时,将iconCls属性值指定为上面定义的类样式abc。如:
[{
text: '目录',
cls: 'folder',
children: [{
text: '叶节点',
leaf: true,
checked: false,
iconCls:'abc'
},{……
……
本文介绍如何在ExtJS中为树节点加载自定义图标。通过定义CSS类和使用iconCls属性,可以轻松地为各个节点指定不同的图标。
270

被折叠的 条评论
为什么被折叠?



