我想在该行中的一个单元格被编辑并设置为某个值后更改该行的字体颜色。myStore 是与 dojox.grid.DataGrid dataGrid 关联的 dojo.data.ItemFileWriteStore。
我写了这个:
myStore.onSet = function(item, attribute, oldValue, newValue) {
if (item.myField == myValue) {
var index = dataGrid.selection.selectedIndex;
dojo.style(dataGrid.getRowNode(index), "color" , "red");
}
}
但不幸的是,这没有任何效果......
更新:我添加了以下样式属性:“backgroundColor”:“red”。好吧,该行的背景颜色变为红色,但是当鼠标移开该行时,颜色会变回默认值!可能是某些默认事件处理程序恢复了默认样式...