2017-10-20 57 views
0

當我通過getSelectedRows在角UI電網

$scope.gridApi.selection.selectRow(rowIndex) 

選擇一行,然後我想

$scope.gridApi.selection.getSelectedRows() 

我得到了0(零)行返回所選行。爲什麼?我究竟做錯了什麼?

+0

沒有人知道,直到你分享更多的代碼 –

回答

0

我不知道rowIndex是什麼,但selectRow()接收對象而不是整數。

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

在一些示例Plunker

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

+0

所以,這是一個黑客.. :)它的工作就像一個魅力現在!謝謝! – lazerbrain