Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

deselect all rows in ng grid

Please find the ng grid example in plunker

http://plnkr.co/edit/CncDWCktXTuBQdDVfuVv?p=preview

It will allow user to select only one row but there will be one selected row at all time. I want to deselect all rows.

like image 566
rajmohan Avatar asked Jan 08 '14 11:01

rajmohan


1 Answers

ng-grid has keepLastSelected option.

Try:

keepLastSelected: false in gridOptions. This will toggle selection.

Example

$scope.gridOptions = { 
      data: 'myData',
      selectedItems: $scope.mySelections,
      multiSelect: false,
      keepLastSelected: false
    };
like image 64
KrishnaDhungana Avatar answered Sep 17 '22 21:09

KrishnaDhungana