网格中没有加载数据。我不是在哪里出错。 HTML:
<div ng-controller="ScoreController">
<div ag-grid="scoreCntl.gridOptions" class="ag-blue"
style="height: 65%">
</div>
</div>
控制器:$scope.gridOptions = {
columnDefs : columnDefs
};
$http.get('url').success(function(data) {
sampleData = data;
$scope.gridOptions.onRegisterApi = function(gridApi) {
$scope.gridOptions.api = gridApi;
$scope.gridOptions.api.setRowData(scoreData);
};
});
答案 0 :(得分:1)
$scope.gridOptions.onGridReady = function () {
$scope.gridOptions.api.setRowData(scoreData);
}