I am struggling with a requirement where I need to highlight a specific cell in a grid using its row and column numbers. However, in the current setup, when I scroll through the grid, other cells are also getting highlighted. It seems like I am not grasping the concept of the UI grid cellClass method correctly. Can someone please provide some insight? If my understanding is wrong, how can I achieve the functionality where only the specified cell will be highlighted based on its row and column number?
Here is the key part of my code along with the plunker link:
var uniqueCellInfoArr = [{"row":2,"col":1},{"row":4,"col":1} ]
cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex)
{
for (var i = 0; i < uniqueCellInfoArr.length; i++)
{
if ( uniqueCellInfoArr[i].row == rowRenderIndex && uniqueCellInfoArr[i].col == colRenderIndex)
{
return "red"
}
}