https://www.bryntum.com/examples/grid/filterbar/
In the above example is it possible to initialize filter bar with all the values in filter items.
https://www.bryntum.com/examples/grid/filterbar/
In the above example is it possible to initialize filter bar with all the values in filter items.
Hello,
It's a bit tricky, but doable. You need to configure initial filter. And since the filter allows multiple values, you need to define the default filter function:
features : {
filterBar : {
compactMode : false,
filter : {
property : 'city',
value : ['Paris', 'Barcelona'],
filterBy(record) {
return !this.value.length || this.value.includes(record.city);
}
}
},
Then also need to specify values for the combo field used for filtering and the filtering function.
filterable : {
// filterField : cityCombo,
filterField : Object.assign(cityCombo, {
value : ['Paris', 'Barcelona']
}),
filterFn : ({ record, value }) => !value.length || value.includes(record.city)
}
Opened a ticket to avoid code duplication: https://github.com/bryntum/support/issues/2993
Pavlo Miklashevych
Sr. Frontend Developer