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

Add multiple filters support #4300

Open
jyotikad2809 opened this issue May 31, 2024 · 1 comment
Open

Add multiple filters support #4300

jyotikad2809 opened this issue May 31, 2024 · 1 comment

Comments

@jyotikad2809
Copy link

Is your feature request related to a problem? Please describe.
Yes so for example let us say that i have a table with 5 fields. For example id, name, age, company-name and country
Now i want datatable to have filters such that each column should have filter.

Describe the solution you'd like

If I fill age as 22 and country as "Z" then i need to show all the rows which have age as 22 and country as z.
Describe alternatives you've considered

Additional context

@m0ksem
Copy link
Collaborator

m0ksem commented Jun 3, 2024

I think we can provide a composable for custom filtering.

const items = ref()

const filters = ref({
   col1: '',
   col2: '',
})

// or filters = ref('') // globally search

const filteredItems = useDataTableFilter(filters)

This way you can manually select which columns to filter and how you deal with filter fields (e.g. it can be input, select, checkbox, whatever).

This is going to be a better solution than using filter function inside data table + better for tree-shaking.

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