I am using Ag-Grid Enterprise and have applied a set filter to a column, so far so good. I am using Server side row model and am pivoting data successfully on the backend (C# ASP.Net Core).
Once a user applies a filter to one column, I want the other column filters to be updated with a new list of available values that has been limited based upon the column filters that are set.
For example:
Colours:
- Black
- Orange
- Red
- Yellow
- Blue
In Rainbow:
- True
- False
Now the idea is that when I set In Rainbow filter to True, I will update the Colours list to exclude black, the logic behind that is done on the C# side and thats fine, basically I fire a query to the server that will include In Rainbow = true, and it will return me an array of the colours that match this particular query.
So I can get the array of colours in javascript back and grab the filter successfully, i.e.
var data = ["Orange", "Red", "Yellow", "Blue"];
var filter = gridOptions.api.getFilterInstance(columnName);
However I cannot find a way to tell ag-grid that I have new values that I want to make available in the set list.
I have tried:
filter.setFilterValues(data);
and
filter.setModel({
type: 'set',
values: data
});
But neither appear to make changes to the set filter values that are available to select.
Any help on this would be greatly appreciated