上线#2 .selectRow()不工作:Angular UI Grid:如何在加载新数据后直接选择一行?
$scope.gridOptions.data = MyResource.query();
$scope.gridApi.selection.selectRow($scope.gridOptions.data[0]); // Select first row
我猜这是行不通的,因为网格还没有完成刷新,又或还没有开始,因为清爽它仍在等待MyResource.query()
的数据。
下也不管用,我不知道为什么:
$scope.gridApi.grid.modifyRows(MyResource.query());
$scope.gridApi.selection.selectRow($scope.gridOptions.data[0]); // Select first row
什么错到底是什么?提前致谢。
这将导致一个空网格 – x74x61
函数modifyRows对我而言不存在,但是当我调用它时不会显示任何错误。它就像什么都没发生.. –