I have tried a few different configurations from looking in the documentation, but no joy. I think I am missing something obvious here.
I can see some examples on forums using filterFunction
, and filterFn
.
Goal
To be able to have the cell values in { id, name }
format, as when they are updated back to the API that is what will be saved and fetched, whilst also being able to use column filters, with OR behaviour.
I've taken an example which shows filtering by city, e.g. filter rows which have a city of 'Paris' or 'Stockholm'.
https://codepen.io/adammarshall84/pen/ZYYNyzW?editors=0010
See the numbered comments there to see where I have intervened.
// 1. Massage data so the value is { id, name }.
// 2. use a template so 'name' is displayed instead of `[object object]`
// 3. now what is the correct filter configuration?
So 3. is the question - what configuration do I need? What things set there are unnecessary?
When I debug locally, for
isIncludedIn(v) {
return this.filterValue.length === 0 || this.filterValue.includes(v);
}
this.filterValue
is an array of numbers (id
) - good.
v
is always an object - bad - I'd like to be id
.