我有ag-grid
的默认过滤器和自定义过滤器。我想清除标签更改的过滤器。
$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>'
};
我试过了,但它没有用
$scope.gridOptions.api.resetFilters();
$scope.gridOptions.api.destroyFilter();
请建议任何方法重置ag-grid
的所有过滤器。
答案 0 :(得分:2)
试试这个:
$scope.gridOptions.api.setFilterModel(null);
$scope.gridOptions.api.onFilterChanged();