Ag Grid cell condition based on the value of cell in a different row

Hi Dash Community:

In Dash Ag Grid, is there a way to define conditions for a cell based on the value of a cell in a different row? In the examples I have read so far in python or javascript, it seems the condition is based on the value of the cells in the same row. T
For example, in the table blow, the cell of value 3 has background color of yellow because the Color row above is “Yellow”. Thanks!
Thanks.
image

Thanks!

Hello @entropy_l,

I don’t know how you would determine the reference row, you could pin it up at the top and then query it from the grids api.

But if this is supposed to be iterated down and adjusting for each row dynamically, you’d have to create the row association accordingly and then make it query the row via the api in the condition, using cellClassRules would account for editing updates as well.

Thank you @jinnyzor.
If I pin the row at the top, can you please suggest how do I get it from the grid API?

Looks like you’ll need to use this:

getPinnedTopRow and if you only keep one row, it should be the first row. :slight_smile:

1 Like

Ok.
I think an easier solution is to use JavaScript Data Grid: Context at least for the simple example above,
Thank you @jinnyzor !

1 Like