External filter in Dash not working

Hello,

I’m working in Dash and I’m trying to filter my Ag-grid table to show only selected values.
I tried everything and it wasn’t working and then I decided to just check if any filters work with this by setting function in doesExternalFilterPass to false so it filters out everything. Even this isn’t working and I have no clue why. The table just flickers.

Callback:

@callback(
        Output(f"{prefix}__feature_selection_table", "dashGridOptions", allow_duplicate=True),
        Input(f"{prefix}__feature_selection_table_switch", "checked"),
        State(f"{prefix}__feature_selection_table", "dashGridOptions"),
        prevent_initial_call=True,
    )
    def filter_only_selected_rows(filter_checked: bool, options):
        grid_options = options
        grid_options["isExternalFilterPresent"] = {"function": "true"}
        grid_options["doesExternalFilterPass"] = {"function": "false"}
        return grid_options

I tried multiple conditions but none seem to work.
Why is this happening?

Hello @nikola,

Welcome to the community!

Could you please let us know what version of the grid you are using?

Could you also please provide a MRE:

This will greatly assist with troubleshooting.

I’m using version 2.4.0 of ag-grid.

I cannot provide MRE because of company policies. Do you have some idea from provided callback why this isn’t working?

Try updating to dash-ag-grid v 30.

I dont think this was implemented until then.

1 Like