天天看点

ext tree 指定节点图标

详细实现可参考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'

},{……

……