I create an ng grid and dynamically add a new row by pressing a button; however, a new row cannot be selected immediately using the grid options - selectRow .
here is a demo: http://plnkr.co/edit/Kqw68GD09Jqqkrf1svGJ?p=preview
Can anyone help me how to make a new row selected after installing it? Thank.
You can try adding watchwith $timeout0:
watch
$timeout
$scope.$watch(function () { return $scope.myData; }, function (newValue, oldValue) { $timeout(function(){ $scope.gridOptions.selectRow(newValue.length-1,true); },0); }, true);
Demo Plunker