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

[2.x] Add MultiSelect table filter #785

Merged
merged 9 commits into from
Dec 11, 2021

Conversation

dllobell
Copy link
Contributor

@dllobell dllobell commented Dec 9, 2021

This pull request adds a MultiSelect based table filter. It simply renders the MultiSelect form component and it uses the whereIn method from the Builder to filter the results.

I had to make two little modifications to the MultiSelect form component:

  1. I added the flex-wrap class to the list of select options since it breaks when too many are selected
    image
    image

  2. I added the stop modifier to the button click event when deselecting an option, without it for some reason it hides the filter dialog on click.

If this pull request is accepted I would happily add the corresponding docs. 👍

@danharrin
Copy link
Member

Hey! This looks good. This morning I added relationship support to the normal select filter. Could you do the same here? Check out this PR for guidance #762.

@dllobell
Copy link
Contributor Author

dllobell commented Dec 9, 2021

Sure!, I just added relationship support, I believe there is no whereInRelation method or something like that in the Builder class so I used the whereHas method directly. Let me know if something is missing.

@danharrin danharrin added enhancement New feature or request pending review labels Dec 10, 2021
@danharrin danharrin merged commit 72addde into filamentphp:2.x Dec 11, 2021
@danharrin
Copy link
Member

This is great, thank you!

@dllobell dllobell deleted the add-multiselect-filter branch May 5, 2022 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pending review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants