I'm using AngularJS and the ng-grid module (v3.0, ui.grid) and as the title says, I'm trying to activate the enableFiltering dynamically in a grid, but i can't and i don't know why. I can change the enableCellEdit behavior on the fly, but the same process doesn't seem to work for enableFiltering (although they both are options equally).
Currently, i'm trying to change the enableFiltering's value this way:
var options = angular.copy($scope.gridOptions[$index]);
options.enableFiltering = true;
$scope.gridOptions[$index] = options;
for ( var i = 0, j = $scope.gridOptions[$index].columnDefs.length; i < j; i += 1 ) {
$scope.gridOptions[$index].columnDefs[i].enableFiltering = true;
}
$scope.gridApi[$index].core.refresh();
I'm creating a lot of grids, because of that i'm using arrays. The main problem is that the grid doesn't change. It happens nothing. Theoretically, enabling this option each column in the grid should show the input for filtering.
Any suggestion?
Thanks a lot!