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

Question - is there a way to search all configured columns? #157

Open
creiner opened this issue Dec 2, 2024 · 2 comments
Open

Question - is there a way to search all configured columns? #157

creiner opened this issue Dec 2, 2024 · 2 comments

Comments

@creiner
Copy link
Contributor

creiner commented Dec 2, 2024

Hi,
I'm looking for the possiblity to add a search all filter.
Is there currently a way to do this?
Thanks!

@creiner creiner changed the title Question - is there a way to search all configures columns? Question - is there a way to search all configured columns? Dec 2, 2024
@Kreyu
Copy link
Owner

Kreyu commented Dec 2, 2024

Hey @creiner.

I think SearchFilterType is what you need. It works kinda like a CallbackFilterType where you need to handle the filtration by yourself, but rendered separately:

https://data-table-bundle.swroblewski.pl/reference/types/filter/search.html

Inside the handler you can add search criteria using LIKE, Full-text-search or whatever you want, on which fields you like.

Of course you can move the logic to the repository, then call the repository method inside the handler.

Please note that if you're using Doctrine ORM, the proxy query passed as the handler's argument will be an instance of DoctrineOrmProxyQueryInterface that you can use like a regular QueryBuilder and call andWhere, orWhere, etc.

@creiner
Copy link
Contributor Author

creiner commented Dec 3, 2024

Hi,
thanks! That will work for me.

I had a look in this part of the documentation, but found no clue about it:
https://data-table-bundle.swroblewski.pl/docs/components/filters.html

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

No branches or pull requests

2 participants