I have an AG grid in my dash app. I want to set the background color of a cell based on a certain condition. It works just fine on initial page load. However, when the data changes in the background and I refresh the page, the styling is not applied even though I see that the data has changed. Example:
columnDefs = [ {'field': 'production_order', 'headerName': 'Production Order', 'headerCheckboxSelection': True, }, {'field': 'reason', 'headerName': 'Missing Data', 'width': 390, 'suppressSizeToFit': True, }, {'field': 'checked', 'headerName': 'Checked?', 'width': 110, 'suppressSizeToFit': True, 'cellStyle': { 'styleConditions': [ { 'condition': "params.data.checked == 'Yes'", 'style': {'backgroundColor': '#90EE90'}, } ] }}, ]
When the checked value changes in the background this is reflected on the page, but the cell is not colored. Also, if the cell was colored green on page load but the checked value is changed to No, the cell remains colored. It seems that the styling is only applied for the original data and not regenerated on page refresh, even though I do regenerate the entire grid. How can I fix this?