【发布时间】:2020-09-25 02:02:11
【问题描述】:
当单元格旧值!=网格中的单元格新值时,我正在尝试更改单元格颜色。
我试过了:
if (e.oldValue === e.newValue) {
e.colDef.cellStyle = function(e) {return { backgroundColor: 'green' };
}
但是当点击保存或重新加载数据时,它会将列颜色更改为绿色。
【问题讨论】:
-
从这个 sn-p 不清楚。你可能需要使用 api.refreshCells()
-
onCellValueChanged = e => { console.log(e); // access the entire event object e.data.modified = true; if (e.oldValue === e.newValue) { e.colDef.cellStyle = function(e) { return { backgroundColor: 'green' }; }; } }我需要更改已更改值的单元格的颜色。