13

I have an issue let me put it simple in my plunker example I want to know why is my $scope.revertSelection() function not working. http://plnkr.co/edit/3KXrUuCsSACuhefmyzxN?p=info

Steps:

  1. Sort right hand grid by Name(descending order)

  2. Select 3-4 rows randomly

  3. Click 'Copy' button all selected rows are copied into $scope.retainSelection

  4. Sort right hand grid by Name(Ascending order)

  5. Click 'Revert' button (this is not working)

I am expecting all the rows previously selected in step 2) to be selected back which is not happening :-( please help me with the issue. I googled but could not find any docs of gridApi.selection to look for other methods to fulfill my requirement.

Note: I am using Ui.grid not ng-grid

1
  • Hello, did you get this to work? Commented Jun 29, 2016 at 8:56

1 Answer 1

19

I should use...

$scope.gridApi.grid.modifyRows($scope.gridOptions.data);
$scope.gridApi.selection.selectRow($scope.gridOptions.data[i]);

...instead of...

$scope.gridApi.selection.selectRow(i);

My friend gave link to docs.

Sign up to request clarification or add additional context in comments.

2 Comments

You'll need to call 'modifyRows' first before 'selectRow' $scope.gridApi.grid.modifyRows($scope.gridOptions.data); https://github.com/angular-ui/ui-grid/issues/2267
I am able to selectRow without modifyRows in 4.0.6

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.