Reputation: 467
ag-grid's asynchronous set filters. These provide significant speed increases and lower transmission payloads for our clients, a very valuable feature. However, we also invoke .setFilterModel in onGridReady to load cached and saved filter configurations. These two features are unable to operate in tandem.
STEPS TO REPRODUCE Method:
Open https://embed.plnkr.co/hhgPgNM2plVpIQbB5aGj/ Select Filter icon on Set filter col column Wait for Set Filter to populate Click Apply Filter using setFilterModel() button. Observe (function behaves as expected)
How Can setFilterModel() initiates values callback function, on success filter model is applied ? or please suggest how can I use synchronous callbacks instead of asynch issue.Thanks
Upvotes: 3
Views: 11894
Reputation: 7614
I played around with the plunker and modified the applyFilter() slightly and this works.
Basically you need to notify ag-grid that you have applied the filter -
function applyFilter(){
// get instance of set filter
var valueFilterComponent = gridOptions.api.getFilterInstance('value');
// use api to select value
valueFilterComponent.selectValue('value 1');
// let ag-grid know that filter was applied
valueFilterComponent.onFilterChanged();
}
More on set filters here
Upvotes: 2