In the grid there is a column, that sets a type for an item. The problem is that when the grids search functionality is used it doesn't work against that columns displayed text, it actually works on the columns ids. Which makes sense because the column itself is a template column and it contains the ids of the types and through the template parameter it sets the displayed value as the text value from the combo.
Is there a way to make the search functionality to search on the displayed values instead?
Screenshot 2022-06-02 112033.png (12.5 KiB) Viewed 487 times
filterable: {
filterFn: ({ record, value }) => {
// Getting the text that is displayed and should be considered for filtering
const valueToCompare = unitComboMap.get(record.value)
// Here I'm considering that's a string comparison, but you can return any
// comparison function, as long as it returns a boolean value
return (
valueToCompare.toLowerCase().indexOf(value.toLowerCase()) !== -1
);
},
filterField: {
type: 'combo',
items: itemTypeArr,
},
},
template: (record) => unitComboMap.get(record.value)
Not supported for now, unfortunately. It looks up on data level and not on UI level.
I've opened a feature request to make it configurable https://github.com/bryntum/support/issues/4745