My question is an extension to thisquestion
Getting select rows from ng-grid?
plunker - http://plnkr.co/edit/DiDitL?p=preview
I need a row to be selected on page load and I need to avoid listening to 'ngGridEventData'
calling $scope.gridOptions.selectRow(2, true); in the controller body fails since the grid has not been loaded.
avoiding listening to ngGridEventData is due to the fact that I need the controller to listen to an event triggered before and based on that I need to select the nggrid row.
any ideas?
Add $timeout
to your Controller and do this:
$timeout(function() {
$scope.gridOptions.selectRow(2, true);
});