How to show list of unique values in Ag Grid filter?

Hi all,

I’m using ag grid community version. How can I get the text filter on the Strategy column (first image) to show the two unique values (Notes and Options) as options to select from similar to Excel filters (second image) or Set Filter in Enterprise version? I’m open to other options as well that would help the user see the unique values in the column to manually type into the filter input box.

FYI - I am using infinite row model and pagination for this ag grid due to large data set. Dash 2.14.2 and Dash Ag Grid 2.4.0.

Another minor issue: I can’t seem to to make filters case insensitive even passing ‘caseSensitive’: False to filterParams doesn’t work (maybe not possible with infinite row model):

{ "field": "Strategy", "filter":"agTextColumnFilter", "filterParams": {"buttons": ["apply", "clear", "reset" ], "closeOnApply": True, "values": ["Notes", "Options"], 'caseSensitive': False} }

filter list 1

filter list 2

Hi @Neil_H

You could make a custom filter component. You can find an example
dcc.RadioItems as a custom filter component in header

You could also use external filters - see a tutorial here:

and dash-ag-grid docs

2 Likes

Hello @Neil_H,

Another thing to note, in the infinite rowModel, the grid cant know what options are available, so its can help you. XD

In the infinite model that you are using, you’ll need to make sure that your python filtering is behaving the way that you want it. IE ignoring case. :smiley:

2 Likes

This is actually a pretty good workaround, thanks so much for sharing.

@jinnyzor actually to follow up on this - do we know if / when the advanced enterprise features (namely, Set Filter and Sidebar with Pivot) will be available for serverSide row model for enterprise users?

I see the workarounds for filtering with infinite row model but to have these advanced features available to abstract away some complexity in the code and have a nice UI available would be great in getting users to adopt our Dash app / ag grid (we have quite a few large data sets 1.5+million rows and there’s a real struggle to pivot / filter the data in Excel).

Hello @Neil_H,

The serverSide row model adds a whole new layer of complexity. We cannot implement this interaction for you due to the nature of how flexible this must be.

I have written a few examples of how to create a custom endpoint for sending the grid requests and some basic interaction for sending the data back. At that point, I can no longer create examples for how your specific grid and db will function.

Understood, thanks as always, Bryan.

1 Like