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
Javascript 如何在用户选中树中的某个节点时将其高亮显示,在取消选中该节点的过程中,在extJs中应将其取消高亮显示>;_Javascript_Extjs_Treepanel - Fatal编程技术网

Javascript 如何在用户选中树中的某个节点时将其高亮显示,在取消选中该节点的过程中,在extJs中应将其取消高亮显示>;

Javascript 如何在用户选中树中的某个节点时将其高亮显示,在取消选中该节点的过程中,在extJs中应将其取消高亮显示>;,javascript,extjs,treepanel,Javascript,Extjs,Treepanel,当用户检查某个节点时,该节点应高亮显示-字体更改或变为粗体。取消选中该节点时,该节点应取消高亮显示,并删除所有新的视觉效果。使用树的viewConfig 树配置: viewConfig: { getRowClass: function(record, rowIndex, rowParams, store){ return record.get("checked") ? "row-highlighted" : "row-nothighlighted"; } } C

当用户检查某个节点时,该节点应高亮显示-字体更改或变为粗体。取消选中该节点时,该节点应取消高亮显示,并删除所有新的视觉效果。

使用树的viewConfig

树配置:

viewConfig: {
    getRowClass: function(record, rowIndex, rowParams, store){
        return record.get("checked") ? "row-highlighted" : "row-nothighlighted";
    }
}
CSS:

如果使用Treegrid,则可以使用
treecolumn
renderer
属性:

.row-highlighted, .row-highlighted .x-grid-cell {
    background-color:#ffc8c8;
}