我正在使用 Dijit 树,我需要在选中(焦点)时更改节点的 CSS 样式。让我们想象一个节点在“取消选择”时是黑色的,而在“选择”时它变成红色,反之亦然。
我应该在我的代码中更改什么?
var tree = new Tree({
model: this._model,
showRoot: true,
autoExpand: true,
persist: false,
getLabel: function (item) {
return item.name;
},
onClick: function (item, node, event) {
businessLogic.goToView(item.id);
}