Text columns with HeaderFilter will filter on null values as "null" string
See original GitHub issueDescribe the bug I have table columns that are string/text types. When I enable filtering, any cell with a null value will filter as if the value of the cell was the string “null”. In testing, I also found that this occurs for “undefined” values as well.
Tabulator Info
- Which version of Tabulator are you using? v4.2.2
Working Example https://jsfiddle.net/haferje/gj0kampx/2/
To Reproduce Steps to reproduce the behavior:
- Go to the JSFiddle URL that I linked
- In the filter of column ‘Col 2’, type the values ‘null’ or ‘undefined’
- See how the values are not treated as empty strings
Expected behavior Typing ‘null’ and ‘undefined’ in the filter should produce no matching rows
Desktop (please complete the following information):
- OS: Windows 10
- Browser: Google Chrome
Additional context
The issue occurs at line 69 of the filter module in initializeColumn()
.
String(column.getFieldValue(data))
produces "null"
and "undefined"
for their respective value.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Filtering Data - Tabulator
Empty Header Filters. By default Tabulator will clear the filter when it considers the header filter value to be empty, in the case...
Read more >Filter on null, blank, or empty values | ThoughtSpot Software
blank or empty values, like an empty string of text or a string ... This formula will show "null" where the value contained...
Read more >ASPxGridView - Header Filter problem when FilterMode is ...
Hello, There is a problem with filtering empty rows when column ... null or empty so it looks like display text is always...
Read more >Data Grid - Filtering - MUI X
The filters can be modified through the grid interface in several ways: ... do not need any value (for instance the isEmpty operator...
Read more >Simple Filters - Angular Data Grid
filter. string | null. The text value associated with the filter. It's optional as custom filters may not ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sorry to hear that. I’ll be patient.
Code change looks good - I’ll try it when I get back to work Monday. Thank you!