Skip to content

Commit

Permalink
fix(selection): allow rowSelection to be navigable if using cellNav; …
Browse files Browse the repository at this point in the history
…allow rowSelection via the space bar
  • Loading branch information
mboriani committed Mar 5, 2015
1 parent b7d6928 commit 3d5d603
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/features/selection/js/selection.js
Expand Up @@ -636,7 +636,8 @@
headerCellTemplate: 'ui-grid/selectionHeaderCell',
enableColumnResizing: false,
enableColumnMenu: false,
exporterSuppressExport: true
exporterSuppressExport: true,
allowCellFocus: true
};

uiGridCtrl.grid.addRowHeaderColumn(selectionRowHeaderDef);
Expand Down Expand Up @@ -765,6 +766,14 @@

var touchStartTime = 0;
var touchTimeout = 300;

$elm.bind('keydown', function (evt) {
if (evt.keyCode === 32 && $scope.col.colDef.name === "selectionRowHeaderCol") {
uiGridSelectionService.toggleRowSelection($scope.grid, $scope.row, evt, ($scope.grid.options.multiSelect && !$scope.grid.options.modifierKeysToMultiSelect), $scope.grid.options.noUnselect);
$scope.$apply();
}
});

var selectCells = function(evt){
if (evt.shiftKey) {
uiGridSelectionService.shiftSelect($scope.grid, $scope.row, evt, $scope.grid.options.multiSelect);
Expand Down

0 comments on commit 3d5d603

Please sign in to comment.