Posted 10 February 2020, 2:38 pm EST - Updated 3 October 2022, 5:39 pm EST
How can I retain custom filter values when the grid data changes?
The column I’m attempting to filter is actually an array of tag values, so I need to set the value filter’s uniqueValues to the set of tags, not the actual data values - in other words, the values should be [“foo”, “bar”, “baz”] not [“foo”, [“foo”, “bar”], “baz”]. I have gotten this working on the initial load of the data, but when I change the underlying data, the filter resets to the values from the data, rather than the uniqueValues I’ve set.
It seems like there’s a grid event that I need to handle and put the custom filter code in the handler, but I can’t figure out what it might be - refreshed and loadedRows put me in an infinite loop, and itemsSourceChanged seems to fire before the filter is updated internally. If I manually fire my custom filter code after a data change (by clicking a button), I get the filter values I expect.
Here’s an example showing the problem:
https://stackblitz.com/edit/angular-qykqjt
And here are some screenshots of the filter drop down:
Thanks!
Natalie