Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #427 #428

Merged
merged 1 commit into from
May 4, 2016
Merged

fix #427 #428

merged 1 commit into from
May 4, 2016

Conversation

Kurtas
Copy link
Contributor

@Kurtas Kurtas commented Apr 28, 2016

FIX #427 The filters doesn't work when the column contains null values

FIX [#427](#427) The filters doesn't work when the column contains null values
@AllenFang AllenFang merged commit 2199431 into AllenFang:master May 4, 2016
@AllenFang
Copy link
Owner

@Kurtas, released on v2.3.0. Thanks your contribution :)

jfremy added a commit to jfremy/react-bootstrap-table that referenced this pull request Jun 15, 2016
The fix for AllenFang#427 (AllenFang#428) is too aggressive in the sense that it prevents altogether to filter in a value of null.
Whatever the input in the filter input, it's impossible to include the line (it returns false systematically to the filter function on a null value)

I'd like to suggest a different fix. Instead of returning false, we set targetVal to the empty string in case the value is null or undefined. I believe this makes sense since the input from the user will be mostly text based (we could imagine custom filters for which it's not true) but in most cases it is. So assuming that having a value of null or undefined maps to an empty string seems sensible.

With that change, it becomes possible to filter in null values using the regex filter for instance and specifying a regex that only allows an empty string.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants