I have the following grid defined in my view
<div class="gridStyle hide" ng-grid="resultsOptions" id="resultsGrid"></div>
And I want to enable multiSelect only when I press the ctrl key. Therefore, I define the multiSelect attribute as false in the controller.
$scope.resultsOptions = { data: 'searchData', selectedItems: $scope.mySelections, multiSelect: false, enableHighlighting: true, enableRowSelection: true };
In the same controller, I have the following code that sets the multiSelect parameter to true.
$("#resultsGrid").keydown(function (e) { if (e.ctrlKey) { $scope.resultsOptions.multiSelect = true; $scope.$apply(); } });
When I launch the application, the value of multiSelect changes after pressing ctrl. But I still cannot make multiple choices.
I tried using a variable for multiSelect, but it does not change anything.
The following example also does not change the multiSelect attribute. But it changes the title of the grid. http://plnkr.co/edit/RwYSG4?p=preview
Is there any simple solution? Or what am I missing in my code?
source share