OneWayTech/vue2-datatable

Filter on datatable not working

Closed this issue · 16 comments

Hi,
I am using vue-datatable-component 2.2 and just followed your advanced example to add filter by using thComp: FilterTh. Noting happening but only TH going to blank, no console error overall.
I have attached code and temple screenshots that may help you to understand what exactly going.
filterth-code
template

thComp: FilterTh

using that already on title field

not string, it's exactly the variable FilterTh

or else you have to register it: components: { FilterTh }

Thanks, It is showing now but not filtering as I am not using _mockData because of I am getting data from API using mapGatters. Here is my code, can you please help me to make that functional.
code

the data rows should be filtered in either the back end or front end according to this.query

but no call going on the server with the update fileter

e.g. this.set(this.query, 'title', <keywords for search>)

or, if you use Vuex, just emit an action to trigger filtering this.data (front-end filtering)

Your filter logic has nothing to do with this project, so I might not help with that

This datatable is just for displaying

Actually query is updating with the filtered value, but it is not filtering data

Yes, and you need to filter the rows yourself

Ok got it, bundle of thanks for the help

e.g. this.data = <originalRows>.filter(row => row.title.includes(query.title))