Is there a way to pre-select a value or values for the filter checkbox?
I am currently saving the last filter so if a user filters, leaves the page, and then comes back the grid is still filtered. The issue I'm having is the filter drop down checkboxes does not reflect the filtered rows.
Here is the code I am using to set the saved filter:
if ($scope.onFilterChanged) {
this.gridOptions.onFilterModified = function () {
$scope.onFilterChanged({filter: ctrl.gridOptions.api.getFilterModel()});
}
}
if ($scope.currentFilter && $scope.onFilterChanged) {
this.gridOptions.api.setFilterModel($scope.currentFilter);
} else {
this.gridOptions.api.setFilterModel(null);
}
setFilterModel works great if I'm not leaving the page and coming back. But I'm not sure why it updates the rows and not the drop down options on page load..Is there a way to get the filtered rows and the check boxes to match on page load?