I am trying to put functionality on a grid to allow rows to be highlighted based on a certain cell criteria. The grid has default styling and I attempt to change some row colors by doing the following:
var col = dhxGrid.getColIndexById(colId);
for (var i = 0;i < dhxGrid.getRowsNum();++i) {
var val = dhxGrid.cells2(i, col).getValue();
if (val.replace(/\s/g, "") == "") {
dhxGrid.setRowTextStyle(this.dhxGrid.getRowId(i), "background-color: yellow");
}
}
This works fine for highlighting rows that are blank. However, if I select a row that is highlighted from that code, it does not show the selected style. I assume this is because the setRowTextStyle() adds inline styles to the rows, and when a row is selected, a class style is applied. So the inline overrides the select style. How can I get a row that’s changed by setRowTextStyle() to show the selected style when I select it?
Thanks for the help.