My table structure is similar to this, https://i.sstatic.net/56TUi.png I am looking to implement a functionality where clicking on the Filter Button will filter out all items that are both male and valid with a value of true.
users = [
{ name: 'ali', male: true, valid: true },
{ name: 'kevin', male: true, valid: false },
{ name: 'meri', male: false, valid: false }
]
get headerst() {
return [
{
text: 'user',
align: 'start',
value: 'name'
},
{
text: 'male',
value: 'male'
},
{
text: 'valid',
value: 'valid'
}
]
}
filterOnlyCapsText(value, search, item) {
return (
value != null && typeof value === 'boolean' && value===true
)
}
filter(){
// i dont know
}
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="14626171607d726d54263a6c">[email protected]</a>/dist/vuetify.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<v-btn @click="filter">filter</v-btn>
<v-data-table
:headers="headerst"
:items="users"
item-key="name"
class="elevation-1"
:custom-filter="filterOnlyCapsText"
>
</v-data-table>
I have attempted writing code for this but it is not functioning properly.
Any suggestions on how to fix this issue?
This additional text serves no particular purpose other than avoiding stack errors. this text is nothing just to avoid stack error this text is nothing just to avoid stack error this text is nothing just to avoid stack error this text is nothing just to avoid stack error