I have a table where I’d like to display each row in a specific color based on the value of a column in the row. Currently, the only way I’ve been able to implement it is to create a custom renderer that checks the value of that column and then adds a class to the parent element of the cell (the tr element). I then apply some CSS to the tr elements.
This works fine, but because I don’t know which columns are going to be rendered, I have to apply the custom renderer to all fifteen columns in the table. This means the logic ends up running multiple times each time the row is rendered, even though it really only needs to be called once.
Ideally there would be a BeforeRowRender hook that would allow me to run this logic just once when the row is rendered, but this doesn’t seem to exist. Does anyone know another way I could avoid having this logic run on every column that gets rendered in the row?