Filter DataTable on array #1831
Unanswered
ratracegrad
asked this question in
PrimeVue
Replies: 2 comments 3 replies
-
Hi @ratracegrad, Could you share a stackblitz link for us? Your 'countries' data is an array and I think you made some custom changes while displaying the nested array in the DataTable. So a sample code would be good for us. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My Data looks like this:
[
{
name: 'Jennifer',
countries: [
{name: 'England', visited: true },
{ name: 'Scotland', visited: true}
]
}
]
I want to be able to filter where 'countries.name' is equal to 'England'
my filters:
const filters = ref({
global: { value: null, matchMode: FilterMatchMode.CONTAINS },
'countries.name': { value: null, matchMode: FilterMatchMode.IN },
})
in my datatable I have
<DataTable
v-model:filters="filters"
:global-filter-fields="['countries.name']
When I select a country like 'England' then the table shows nothing.
Any suggestion on what I am doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions