Re-render ALL visible cells after ag-grid filterModel is changed

Hi,

I am wondering if it is possible to force the ValueFormatter / CellRenderer to re-run after the ag-grid’s filter model is changed.

Thanks

Here’s some general info on refreshing cells and redrawing rows. If you give more details about what you are looking for, it will be easier to help.

https://ag-grid.com/react-data-grid/view-refresh

1 Like

Thanks, that is what I needed.

I created a clientside callback to run the gridApi.refreshCells() command whenever the grid’s filterModel is changed:

# refresh cells whenever the filterModel is updated
clientside_callback(
    """
    function() {
        const gridApi = dash_ag_grid.getApi('grid-id');
        var params = {
            force: true,
            suppressFlash: true,
        };
        gridApi.refreshCells(params);
        return ''
    }
    """,
    Output('filterModel__test', 'data-label'),
    Input("grid-id", "filterModel"),  # activate any time the filterModel is changed
)

Unfortunately this does still require a dummy div for the output–not sure why there is no option in dash for no output

html.Div(id='filterModel__test', **{'data-label': {}}),

Thanks

1 Like