【发布时间】:2011-07-29 22:24:17
【问题描述】:
我想在该行中的一个单元格被编辑并设置为某个值后更改该行的字体颜色。 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”。好吧,行的背景颜色变成了红色,但是当鼠标离开行时,颜色又变回了默认值!可能是某些默认事件处理程序恢复了默认样式...
【问题讨论】: