Open ghost opened 4 years ago
HI all,
i have the same problem. I try to add a filter on multiple columns. But the filters needs to be dynamicly loaded based on the value of an other filter. My Code works, but i get an extreme delay because of an infinite update loop.
Error Message:
vue.runtime.esm.js?2b0e:619 [Vue warn]: You may have an infinite update loop in watcher with expression "columns"
found in
---> <VgtFilterRow>
<VgtTableHeader>
<VueGoodTable>
<Anonymous>
<Main> at src/views/Main.vue
<App> at src/App.vue
<Root>
My Code:
onColumnFilter(params){
// console.log('company.name' in params.columnFilters);
if('company.name' in params.columnFilters)
{
const result = this.companies.find( companie => companie.name === params.columnFilters['company.name']);
const groupColumn = this.columns.find(element => element.field == 'group.description');
this.$set(groupColumn, 'filterOptions', {
enabled: true,
placeholder: 'Alle',
filterDropdownItems: result.groups,
});
}
},
Where is the best place to dynamically add
filterDropdownItems
based on an API response? I have tried inbeforeUpdate
Vue method but it is callingonColumnFilter
every second.