There is no way changing the showSelectionCheckbox property dynamically, but there is always the ugly workaround of using 2 grids and showing one of them based on the selection.
Example:
html:
<button ng-click="changeGrid()">test</button>
<div class="gridStyle" ng-if="!showSelectionCheckbox" ng-grid="gridOptions"></div>
<div class="gridStyle" ng-if="showSelectionCheckbox" ng-grid="gridOptions2"></div>
js:
var app = angular.module('myApp', ['ngGrid']);
app.controller('MyCtrl', function($scope, $http) {
$scope.showSelectionCheckbox=false;
$scope.myData = [{"name": "Moroni", "allowance": 50},
{"name": "Tiancum", "allowance": 53},
{"name": "Jacob", "allowance": 27},
{"name": "Nephi", "allowance": 29}],
$scope.gridOptions = {
data: 'myData',
showSelectionCheckbox: false,
};
$scope.gridOptions2 = {
data: 'myData',
showSelectionCheckbox: true,
};
$scope.changeGrid = function () {
$scope.showSelectionCheckbox=!$scope.showSelectionCheckbox;
}
});
Live example: http://plnkr.co/edit/4u7iz7R8EKXdoNnoR5MS?p=preview