I'm color coding some cells in a grid with code similar to the snippet below.
1. Is this the most efficient way to perform cell level conditional formatting? I have some pretty large datasets, and it doesn't seem like a great solution.
2. Locking columns breaks this logic by changing the cell's array position. Is there a way around this without parsing through the entire grid when a column is locked?
var
grid = $(
'#myGrid'
).data(
'kendoGrid'
);
var
rows = grid.tbody.find(
" > tr"
);
var
rowCount = grid.tbody.find(
" > tr"
).length;
if
(rowCount > 0) {
for
(
var
x = 0; x < rowCount; x++) {
var
dataItem = grid.dataItem(rows[x]);
var
row = rows[x];
if
(dataItem.foo ===
'bar'
) {
row.cells[0].style.backgroundColor =
"#e0e0eb"
;
}
}