0
votes

I'm using a slickgrid to display certain values. Upon satisfying a particular condition, i'm highlighting the cells with yellow color using the statement

$($('.grid-canvas').children()[args.row].children[args.cell]).context.style.background = "yellow";

I'm holding this slickgrid under a <div>. Now as the number of rows increase, a scrollbar appears within the <div>. As i scroll down to reach the last row and then scroll back up to the first row, the cell colors that were initially there in the cells of the top rows are lost.

1

1 Answers

0
votes

Because Slickgrid will redraw the grid upon scrolling (instead of storing all data in DOM tree), so what you set in DOM will be reset, we have to use the API of Slickgrid to set background at specific row, column : grid.setCellCssStyles(key, hash)

https://github.com/mleibman/SlickGrid/wiki/Slick.Grid#setCellCssStyles

you can look demo here: http://jsfiddle.net/n58Cq/90/