DataTable filtering

Hello,

I implemented a table with front-end filtering as described in the documentation:
https://dash.plot.ly/datatable/filtering

My question is:
Is it possible to modify the filters? For example, so that “asia” returns the same result as “Asia”.

Thanks!

You should tweak the filtering function a little:

Instead of:

elif operator == 'contains':
            dff = dff.loc[dff[col_name].str.contains(filter_value)]

You should change it to:

elif operator == 'contains':
            dff = dff.loc[dff[col_name].str.contains(f'(?i){filter_value}')]

That will make the filter not case sensitive.

1 Like

Thanks @marlon. So I guess this is only possible with back-end filtering?

Not sure. But that’s the path that I took since it’s more flexible and based on the documentation, it runs faster especially on large datasets.

Yes. I took the other route. I’ll probably switch now. Thanks again!