-
Notifications
You must be signed in to change notification settings - Fork 786
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
headerFilter min/max shows all rows if focused #2409
Comments
Yes, this is because the value of the number editor only changes once the cursor leaves the input element. This is done because in most cases people only want to filter on exact numbers (ie a person typing in 50 dosn't want to filter on any number containing 5 while they are first typing the number) but with text editors user are usually interested in seeing the filter applied as they are typing. You can easily make it so that the filter is applied in real time, if you have a look at the JavaScript for the filter, you will see in the keypress function that it triggers the buildValues function when the enter key is pressed (keycode 13) you could take off this restriction then it would filter the values on every keypress. I hope that helps, Cheers Oli :) |
Thanks for the response. As I understood your thoughts, I could not get it to work as I desired, but I was able to with the following code/changes:
|
@paulcsf I tried your solution but after hitting the enter key the table did not filter. Does your fix solve the issue of the table filtering then unfaltering even if both the min and max have a value? |
The same thing happens to me but in version 5.2. Any solution to filter as we add number or when we press enter?. |
@JaumeAG That will be down to the event bindings in your editor, you have total control on how your custom editor functions, if you want it to behave differently simply add/remove the event bindings as needed that then call the success or cancel functions |
On the example page (and my code), the filterHeader with min/max shows all rows if the input is focused.
http://tabulator.info/examples/4.4#filter-header
Click in the min filter, type 50, no change.
Hit enter, the list filters briefly, then un-filters.
Tab to the max filter, the list filters briefly, then un-filters.
Tab to the gender filter, the list filters as expected.
With a few exceptions(?, random?) if one of the min or max filters is focused, the list is un-filtered regardless of the value in the filter box.
Is this expected? If so, is there a way to disable/override the behavior?
The text was updated successfully, but these errors were encountered: