Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

Conditional Formatting / Column locking

$
0
0

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?

 

vargrid = $('#myGrid').data('kendoGrid');
        varrows = grid.tbody.find(" > tr");
        varrowCount = grid.tbody.find(" > tr").length;
        if(rowCount > 0) {
            for(varx = 0; x < rowCount; x++) {
                vardataItem = grid.dataItem(rows[x]);
                varrow = rows[x];
                if(dataItem.foo === 'bar') {
                    row.cells[0].style.backgroundColor = "#e0e0eb";
                }
}

Viewing all articles
Browse latest Browse all 84751

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>