我有一个像http://jsfiddle.net/bmbMy/的树面板
我尝试通过使用CSS更改默认图标(节点和叶)。但这不起作用。

.x-grid-row  .x-grid-tree-node-expanded {
    background: url('http://icons.iconarchive.com/icons/sekkyumu/developpers/16/Play-Green-Button-icon.png') no-repeat center center !important;
}
.x-grid-row  .x-grid-tree-node-leaf {
    background-image:url('http://icons.iconarchive.com/icons/graphicrating/koloria/16/Button-Play-Pause-icon.png');
}

我该怎么办,谢谢

最佳答案

您尚未覆盖正确的CSS类。这是您需要的:

.x-grid-tree-node-expanded .x-tree-icon-parent {
    background: url('http://icons.iconarchive.com/icons/sekkyumu/developpers/16/Play-Green-Button-icon.png') no-repeat center center !important;
}
.x-grid-row  .x-tree-icon-leaf {
    background-image:url('http://icons.iconarchive.com/icons/graphicrating/koloria/16/Button-Play-Pause-icon.png');
}

以及更新的jsfiddle

关于Extjs Treepanel : CSS to change default icons (node and leaf),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/17631880/

10-08 22:09