I have default filter and custom filter for ag-grid
. I want to clear filter on tab change.
$scope.gridOptions = {
columnDefs: columnDefs,
rowData: null,
angularCompileRows: true,
enableSorting: true,
enableColResize: true,
enableFilter: true,
rowHeight: 35,
rowSelection: 'single',
onSelectionChanged: onSelectionChanged,
isExternalFilterPresent: isExternalFilterPresent,
doesExternalFilterPass: doesExternalFilterPass,
overlayLoadingTemplate: '<span class="ag-overlay-loading-center">Please wait while your rows are loading</span>',
overlayNoRowsTemplate: '<span style=" transform: translateY(-50%);opacity: 0.25;font-size: 3em;">No data available</span>'
};
I tried this but it's not working
$scope.gridOptions.api.resetFilters();
$scope.gridOptions.api.destroyFilter();
Please suggest any method to do reset all filters of ag-grid
.
Try this:
$scope.gridOptions.api.setFilterModel(null);
$scope.gridOptions.api.onFilterChanged();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With