我正在使用ui-grid。用例是在单击按钮时添加新行。我想把重点放在新添加的行的第一个单元格上有关如何做的任何建议吗?这是plunkr
的相同内容。
http://plnkr.co/edit/6zyZ5q
$scope.addNew = function() {
var newobj = {"id": "","name":"" };
$scope.gridOptions.data.unshift(newobj);
$scope.gridApi.core.notifyDataChange(uiGridConstants.dataChange.ROW);
//set focus to the new row
$scope.gridApi.cellNav.scrollToFocus( $scope.gridOptions.data[0], $scope.gridOptions.columnDefs[0]);
};
答案 0 :(得分:2)
auto v1 = &px
我希望它有所帮助。