我想突出显示 Ext.tree.Panel 中的一些节点。
在 Ext3 中,我通过向树节点 ui 对象添加一个类来完成此操作:
// add a class with to highlight the node
myTreeNode.getUI().addClass('highlightclass');
// remove the class to remove the highlighting
myTreeNode.getUI().removeClass('highlightclass');
Ext4 中的等效项是什么? 我已经能够通过设置节点模型的 iconCls 字段来更改图标,但我真的希望能够设置一个允许我突出显示整个节点的类。
最佳答案
这是我为自己的问题找到的答案:
// add a css class to a specific tree node
myTreePanel.getView().addRowCls(myTreeNode,'highlightclass');
// remove a css class from a specific tree node
myTreePanel.getView().removeRowCls(myTreeNode,'highlightclass');
关于javascript - 如何将 css 类添加到 Ext4 中的树节点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11054500/