Reputation: 1
Need one help please. I am using Ag Grid in Vue js.... have a situation where i need to turn off the checkbox in filter on load initially so that the grid wont show the records at the beginning. Is it possible?
For eg in the below link(screenshot) , I need to uncheck the "Completed" status on load and the grid wont show the records with "Completed" status.
Any help would be highly appreciated ...Thanks
Upvotes: 0
Views: 442
Reputation: 5113
You can execute setFilterModel
on firstDataRendered
event
(firstDataRendered)="onFirstDataRendered($event)"
onFirstDataRendered(params){
this.preDefinedFilter();
}
preDefinedFilter(){
let hardcodedFilter = {
// 'status' - field name with 'filter: "agSetColumnFilter"' difinition in colDef
// list of statuses which will be displayed
status: ["Uncompleted", "Error", "Whatever"]
};
this.gridApi.setFilterModel(hardcodedFilter);
this.gridApi.onFilterChanged();
}
don't blame me, the sample written on angular but I suppose it wouldn't be hard to adapt the solution.
Upvotes: 1