I'm trying to change the background color of multiple rows based on data returned from a SQL query. I'm using JSON as my data type and have tried using loadComplete to iterate through the grid and color the rows by adding a css class after the grid is loaded. This works but I have 1000's of rows returned and this method greatly slows down the loading of the grid. The user has to wait a long time before the grid is finally loaded.
I haven't tried using a customer formatter to color the rows because I'm told the grid will not be available yet when the customer formatter is triggered so there would be an error? I have seen documentation on setting a timeout period so the grid is available in the DOM for the customer formatter but this sounds like it would slow the loading of the grid which is what I'm trying to avoid.
Ideally I would like to assign a class to the row during the server call (PHP) based on table data and then when the grid is loaded on the client side it colors the row based on a css style. It seems that assigning a class on the server side would be the most efficient way so I don't have to cycle through the data more than once or draw the grid more than once? What other techniques are available for doing this? Thanks!