dash icon indicating copy to clipboard operation
dash copied to clipboard

[Bug] DataTable - Cannot programmatically clear filters

Open jborman-exos opened this issue 3 years ago • 2 comments

Describe your context

dash                          2.3.0
dash-bootstrap-components     1.0.3
dash-core-components          2.0.0
dash-daq                      0.5.0
dash-html-components          2.0.0
dash-table                    5.0.0

Describe the bug

There is no way to programmatically clear a filter applied to a DataTable column via a callback. This has been documented by several other users in both the community forum and the old dash-table repo prior to the 2.0 release.

References:

According to the references above, the filter_query property only reacts to valid, non-empty strings like '{col_1} = abc'. Requiring a valid, non-empty string prevents resetting the filter_query to an empty state.

Expected behavior

There should be a way to clear this displayed filter text via a callback. Possibly through some new operator in the filter_query syntax like '{col_1}' EMPTY

Screenshots

See references above.

jborman-exos avatar Mar 15 '22 15:03 jborman-exos

A clean solution for the issue would be greatly appreciated. Some of the workarounds referenced in the links above indicate the user should update the filter to '{col_1} != <impossible-value>', but this is a messy solution that will confuse users.

I'd be happy to look into a solution with some direction/feedback from the core devs first.

jborman-exos avatar Mar 15 '22 15:03 jborman-exos

Hey, i had the same issues and i found this: https://github.com/plotly/dash-table/issues/370#issuecomment-1044635156. It works for me. Help it's helpful.

mz09code avatar Sep 03 '22 01:09 mz09code