Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ExtJS4树图标_Extjs_Extjs4_Extjs4.1 - Fatal编程技术网

ExtJS4树图标

ExtJS4树图标,extjs,extjs4,extjs4.1,Extjs,Extjs4,Extjs4.1,当节点支持展开/折叠时,如何在每个节点的基础上更改树节点图标 例如,我可以使用以下CSS全局设置树的展开/折叠图标: #reports-tree .x-tree-icon-parent { background-image: url('../images/tree/folder_closed.png'); background-repeat: no-repeat; } #reports-tree .x-grid-tree-node-expanded .x-tree-icon-p

当节点支持展开/折叠时,如何在每个节点的基础上更改树节点图标

例如,我可以使用以下CSS全局设置树的展开/折叠图标:

#reports-tree .x-tree-icon-parent
{
    background-image: url('../images/tree/folder_closed.png');
    background-repeat: no-repeat;
}

#reports-tree .x-grid-tree-node-expanded .x-tree-icon-parent
{
    background-image: url("../images/tree/folder_opened.png");
    background-repeat: no-repeat;
}
我还可以使用
iconCls
作为标准设置单个
leaf
图标


但是,在某些情况下,我有一些非叶节点,我想给它们一个自定义图标,而不是使用普通的展开/折叠图标。

解决方案似乎是插入
!图标CSS的重要信息,例如:

.sg-arp-reports-tree-report-stim {
    background-image: url('../images/tree/report_stim.png') !important;
    background-repeat: no-repeat;
}

这似乎与预期一样有效,并且无论展开/折叠或叶/非叶,图标都保持不变。

解决方案似乎是插入
!图标CSS的重要信息,例如:

.sg-arp-reports-tree-report-stim {
    background-image: url('../images/tree/report_stim.png') !important;
    background-repeat: no-repeat;
}
这似乎与预期的一样有效,无论展开/折叠或叶/非叶,图标都保持不变。

这应该对您有所帮助

#helpContentsTree .x-tree-node-expanded  .x-tree-node-icon
{
    background-image: url("test1.gif") !important;
    background-repeat: no-repeat;
}
#helpContentsTree .x-tree-node-collapsed   .x-tree-node-icon
{
    background-image: url("test.jpg") !important;
    background-repeat: no-repeat;
}
这应该对你有帮助

#helpContentsTree .x-tree-node-expanded  .x-tree-node-icon
{
    background-image: url("test1.gif") !important;
    background-repeat: no-repeat;
}
#helpContentsTree .x-tree-node-collapsed   .x-tree-node-icon
{
    background-image: url("test.jpg") !important;
    background-repeat: no-repeat;
}

是否要更改
+
-
图标?否。我要更改实际的节点图标。然后在渲染之前更改
图标类。你能显示你的JS代码吗?你想更改
+
-
图标吗?不。我想更改实际的节点图标。然后在渲染之前更改
图标类。您可以显示您的JS代码吗?
sg arp reports tree report stim
是非叶节点的默认iconClass吗?改变ExtJS核心不是一个好的做法。嗯?我没有改变任何
core
这只是为
iconCls
指定的自定义CSS类。所有默认的Ext JS CSS类都以
x-
前缀开头。沙盒CSS类以
x4-
开头。
sg arp reports tree report stim
是非叶节点的默认iconClass吗?改变ExtJS核心不是一个好的做法。嗯?我没有改变任何
core
这只是为
iconCls
指定的自定义CSS类。所有默认的Ext JS CSS类都以
x-
前缀开头。沙盒CSS类以
x4-
开头。