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

Need raw filter term #2475

Closed
eirenik opened this issue Jan 2, 2015 · 4 comments
Closed

Need raw filter term #2475

eirenik opened this issue Jan 2, 2015 · 4 comments

Comments

@eirenik
Copy link

eirenik commented Jan 2, 2015

When implementing a custom filter, the search term is modified before being provided to the filter function. These modifications make it difficult or impossible to implement desired filtering logic.

There needs to be some way to get the "raw" term that the user typed in. I think this should be the default behavior for all custom filters, but an option like "filterRaw:true" might be fine if needed for compatibility.

@axelstudios
Copy link

This caused problems for me as well until I started searching through the code and saw that I just needed to use the escaped searchTerm in a RegExp constructor rather than doing any kind of substring matching.

Previously, my workaround was to strip backslashes from searchTerm, which worked great for everything except actual backslashes in the raw filter, but RegExp is the way to go.

@eirenik
Copy link
Author

eirenik commented Jan 11, 2015

That would be fine if one's goal was to do exactly what the grid code does with filters, but the whole point of a custom filter is to do something different. Possibly extremely different.

The whole idea of extensibility is recognizing that you can't predict everything that will make sense for everyone and every possible application's data. Maybe I want '@' to be a wildcard. Maybe I want to append '5' to every 'k' in the filter. Whatever it is, providing the raw input from the user is essential for permitting customization.

@PaulL1
Copy link
Contributor

PaulL1 commented Jan 20, 2015

I can also mark this as a future enhancement, and happy to accept a pull request that adds this functionality.

At the moment the (quite small) development team are focusing their time on stability and reaching an initial release of 3.0, not new functionality.

@PaulL1 PaulL1 added this to the Future milestone Jan 20, 2015
@PaulL1
Copy link
Contributor

PaulL1 commented May 27, 2015

We have provided the ability to define custom filter widgets and custom filter behaviour. I think this should meet the needs here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants