Is there any way to implement a case-insensitive filter/search in a dash datatable? Basically if I am searching for “Cat” i would like to be able to search “cat” and get the same element in the table. This of course assumes there is no element named “cat” in the table.
You could make the strings all caps, or you could use the filtering with python and with python using the ‘contains’ operator to compare after using the lower on both strings, but I agree this is cumbersome for such a common filtering functionality. Would be nice to have this out of the box or have an attribute along the lines of “filter_case_sensitive” attribute in the DataTable
No updates unfortunately- none of our customers have yet requested this feature so it’s on the back burner while other requested features get built. That being said, we made a PR that got partly there and this would be a good project for someone in the community to pick up and bring across the finish line. We’re happy to mentor anyone interested.
There are no updates yet but we are hoping to schedule this one in in the next few weeks. A gracious sponsor has sponsored this work (among other items we’re working through!) and so it is in the pipe.
Yes, you can select whether the filter is case sensitive or not on the table or column level with the filter_options prop. This is from the DataTable Reference
filter_options ( dict ; optional): There are two filter_options props in the table. This is the table-level filter_options prop and there is also the column-level filter_options prop. These props determine whether the applicable filter relational operators will default to sensitive or insensitive comparison. If the column-level filter_options prop is set it overrides the table-level filter_options prop for that column.
filter_options is a dict with keys:
case ( a value equal to: ‘sensitive’ or ‘insensitive’ ; optional)