-
Notifications
You must be signed in to change notification settings - Fork 137
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
Unable to filter on negative numbers #464
Comments
That's interesting, I don't think I ever considered that case. I don't have time to test this right now, but it's possible changing the regex on this line to |
I installed a local copy of your package and edited that line, but it still does not work. Once that minus sign is typed, the following conditional (line 102) never evaluates as true: if (numberRegExp.test(filterWord)) {
var numberQuery = {};
numberQuery[field] = parseInt(filterWord, 10);
filterQueryList.push(numberQuery);
} In fact, entering -999 has filterWord evaluate to "\-999" which is why it's always false... |
Thanks for trying that - it's escaping the dash so it won't be evaluated as a regex. |
It seems like rather than escaping the dash than removing it later, you should instead determine earlier if the string is a number or not: |
You're right, that would be better. If you have it working locally, feel free to open a pull request. |
Unfortunately, I don't have the time myself to work out all the details. |
I have a simple table where one of the columns contains signed integers (statusCode in example below). I can only filter the rows by those integers when the integer is positive. Entering "-999" (one of the unfiltered values) results in 0 records found.
I am NOT using regex searches.
Template:
{{> reactiveTable collection=failingResources settings=settings}}
Helper:
The text was updated successfully, but these errors were encountered: