2

Can I get a ui-grid with selection plugin enabled but without check column showing?

My html mark

<div class="grid300" ui-grid="gridOptions" ui-grid-selection></div>

My js config

$scope.gridOptions = {
    data: 'dirs',
    enableSelectAll: false,
    onRegisterApi: function(gridApi) {
        $scope.gridApi = gridApi;

        gridApi.selection.on.rowSelectionChanged($scope, onRowSelection);
    },
    columnDefs: columnDefs
};

Expected Result:

My grid without the first checkbox column.

jesus.saad
  • 139
  • 2
  • 5

1 Answers1

3

As stated at http://ui-grid.info/docs/#/tutorial/210_selection:

By default the module will provide a row header with checkboxes that allow selection of individual rows. If you set the enableRowHeaderSelection gridOption to false, then the row header is hidden and a click on the row will result in selection of that row.

so, just add enableRowHeaderSelection: false

$scope.gridOptions = {
  enableRowHeaderSelection: false, 
  data: 'dirs',
  enableSelectAll: false,
  onRegisterApi: function(gridApi) {
    $scope.gridApi = gridApi;

    gridApi.selection.on.rowSelectionChanged($scope, onRowSelection);
  },
  columnDefs: columnDefs
};
Andriy
  • 14,781
  • 4
  • 46
  • 50