gpt4 book ai didi

javascript - 在 TreePanel 中设置节点的图标

转载 作者:行者123 更新时间:2023-11-30 05:56:56 26 4
gpt4 key购买 nike

ExtJS 4:

我创建了一个树面板。我想为其节点设置自己的图标,因此我为每个节点使用了 iconCls 属性。它的工作。但是当我展开一个节点时,它会返回到其正常的“打开文件夹”图标。

var treeObject = {
text: "BANK OF AMERICA 1",
cls: "enterprise",
children: [
{
text: "core outputs",
cls: "businessUnit",
iconCls: 'abc'
}
],
iconCls: 'abc',
leaf: "false",
expanded: true,
type: "enterprise"
}
treePanel.setRootNode(treeObject);

请提出一些建议来避免这个问题。

最佳答案

尝试像这样指定您的 css 类,以防止被 extjs 的默认类覆盖

.x-grid-tree-node-expanded .x-tree-icon-parent.abc{
background: url(abc) x y no-repat !important;
}

关于javascript - 在 TreePanel 中设置节点的图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11259507/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com