Vue-good-table: Slots for custom filters

Created on 27 Feb 2020  路  6Comments  路  Source: xaksis/vue-good-table

@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!

enhancement help wanted

Most helpful comment

@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.

All 6 comments

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.

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.

any movement here?

@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.

@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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sorayadragon picture sorayadragon  路  7Comments

mustfullDev picture mustfullDev  路  3Comments

Sharvadze picture Sharvadze  路  4Comments

hoanghiep1x0 picture hoanghiep1x0  路  5Comments

advicepyro picture advicepyro  路  3Comments