Angular UI网格中的getSelectedRows

时间:2017-10-20 11:18:21

标签: angularjs angular-ui-grid

当我按

选择一行时
$scope.gridApi.selection.selectRow(rowIndex)

然后我想通过

返回选定的行
$scope.gridApi.selection.getSelectedRows() 

我有0(零)行。为什么?我做错了什么?

1 个答案:

答案 0 :(得分:0)

我不知道rowIndex是什么,但selectRow()接收对象而不是整数。

例如:$scope.gridApi.selection.selectRow($scope.gridOptions.data[0])

Plunker

中的一些示例

参考:ui-grid.info/docs/#/tutorial/210_selection