-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Labels
Milestone
Description
I have a need to select rows programmatically after data is loaded. For example select row0 as soon as data is loaded.
Data, when loaded, is obviously missing $$hashkey and thus unable to be selected. I created ugly workaround by calling select function with $timeout.
This doesn't work:
$scope.gridOptions.data = someData;
$scope.gridApi.selection.selectRow($scope.gridOptions.data[0]);
This works:
$scope.gridOptions.data = someData;
$timeout(function () {
$scope.gridApi.selection.selectRow($scope.gridOptions.data[0]);
},
100)
I spent some time trying to find event after data is processed by ui-grid but I was unable to. If there is any more elegant solution it would be quite appreciated,
ggoomggoo