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

Slots for custom filters #675

Closed
davidjr82 opened this issue Feb 27, 2020 · 6 comments
Closed

Slots for custom filters #675

davidjr82 opened this issue Feb 27, 2020 · 6 comments

Comments

@davidjr82
Copy link

@TheJaredWilcurt I am openning this ticket to discuss the idea expressed in #668 as @xaksis suggested.

The point is that recently, the multiselect filter has been merged in #587. Although this is really nice, it has downsides too:

  • Users only can use this multiselect component, and not other one if they would want to.
  • Package has more kb, even a user doesn't want to use it.

Imagine a user now wants to have a date filter, and submit a PR with it. Other wants a range date filter. More PRs.

If we can use a slot to provide the filter each user wants, we can keep the package slim, and let the users to use the filter they want, and provide an example in docs for a "default filter" if they want to use a standard filter.

There are other opened issues that could be closed with this implementation, for instance, #664 #661 and more. Something good of this approach is that the maintainance of the filters wouldn't be on our side, but in the user side.

I would like to do it by myself, but I am beginning recently with this library and I feel that I don't have enough knowledge of it to make those changes.

Thanks!

@TheJaredWilcurt
Copy link
Collaborator

This is a good idea. I don't have time to work on it at the moment however (traveling for work). But this is a better overall approach to what is currently in use. Accepting PRs.

@xaksis
Copy link
Owner

xaksis commented Feb 29, 2020

Consolidating, #616, #655,

@pres-camacho
Copy link

Since vue-good-table is a real benefit in our project and this feature really happens to be missing for us, i'd like to apply for this task.

@Josh-of-TT
Copy link

any movement here?

@robgaston1
Copy link
Contributor

@Josh-of-TT (and @xaksis) I put a PR up for this.

I added and exposed a function through the new slot so that users who want to can still have their custom filter values passed into the table. If that works out, I know it would be helpful for the way we use the table.

@TheJaredWilcurt
Copy link
Collaborator

@davidjr82 @pres-camacho @Josh-of-TT

As of v2.21.0 Vue-Select is no longer a dependency of Vue-Good-Table.

We have replaced it with a new feature of a custom filter slot. You can now pass in any component for custom filtering. There is a migration guide for how to add Vue-Select to your project and get the same functionality back.

Closing this issue.

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

6 participants