-
Notifications
You must be signed in to change notification settings - Fork 352
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
The fields "text" and "number" set default value in the filter when no value has been entered by the user #125
Comments
In checkbox we have this implementation, because we need third state, |
In case of empty string, you can indeed discuss that this is fine, however for an integer, the default value would be 0, which does not differ from a real 0 value, if you want to search for for all products which are sold out (number-in-stock=0) for example. So for integer values, returning 'undefined' would be the best option. And if you build it for checkbox and integers, maybe it's best to build the same logic for all types. |
For number field, it sounds really reasonable. |
@tabalinas I cant implement search for number field because I cant recognize if the user entered 0 or the number field is empty !!! thank you for your efforts |
As this |
For the jsgrid.field.text, when the user does not search for this column, the filter still contains the default value ("" = empty string).
My proposal is to modify the filterValue function into:
When do value is entered, this will return undefined.
Same as in the CheckboxField code:
Same for the jsgrid.field.number, the default value contains a integer 0 when the user does not search on this.
But if this change breaks the implementation, it's maybe better to add a property named filterValueHasValue like this:
The text was updated successfully, but these errors were encountered: