Can I dynamically update the background color of a row in an AG Grid?

I have an AG Grid of data, and the background color is based on the value of the ‘Rank’ column.

I accomplish this using the getRowStyle[‘styleConditions’] property.

I made the Style column editable in-line, using a dropdown.

So, for example, the user can change the value from ‘low’ to ‘high’.

I have a handler for this to update the database value, and I’m using the columnState from the grid in my callback to re-set the sorting.

But I can’t figure out how to update the color of the changed row.

For example, if a row with Rank ‘low’ is supposed to be red, but a row with Rank ‘high’ is supposed to be yellow, and the user changes from ‘low’ to ‘high’, how do I dynamically change the red row to be yellow?

I’m taking the getRowStyle property as a State in the callback, and also returning it as an output, but that doesn’t seem to be enough.

Hi @zack_nc

This post might be helpful: Use color picker to color rows in dag.AgGrid - #5 by AnnMarieW