How to set row selection to newly added row?
问题 I need to set selection to a newly added row. When $scope.gridApi.selection.selectRow(newObject) is entered, the grid's row model does not have the new row and thus can not select it. After method addRow is finished, the grid shows the new row (and the data) but no selection was made. My test code: $scope.addRow = function() { $scope.gridOptions.data.unshift({ // my new data object }); var newObject = $scope.gridOptions.data[0]; $scope.gridApi.selection.selectRow(newObject); }; How can I