0
我有剑道网格,由角控制器控制:如何显示在剑道格列相关的外键数据
<div>
<kendo-grid options="mainGridOptions" k-data-source="gridData">
</kendo-grid>
</div>
UPDATE 的数据加载,但网格ISN” t呈现。 (我也有一个期限错配和处理领域的地位。
"use strict";
angular.module("tenderApp")
.controller("tenderCtrl", ["$scope", "adalAuthenticationService", "tenderSvc", "$q", function ($scope, adalService, tenderSvc, $q) {
$scope.mainGridOptions = null;
$scope.gridSource = null;
$scope.statusData = null;
function loadStatusData() {
return tenderSvc.getSector()
.then(function(sector) {
$scope.sectorData = sector.data.map(function (obj) {
return {
text: obj.bezeichnung,
value: obj.id
};
});
return $scope.sectorData;
});
}
function loadGridSource(result) {
return tenderSvc.getItems()
.then(function (res) {
$scope.gridSource = res.data;
return res.data;
});
}
loadStatusData()
.then(loadGridSource)
.then(function (res) {
//both properties are available at this point
console.log($scope.gridSource);
console.log($scope.sectorData);
$scope.gridData = new kendo.data.DataSource({
transport: {
read: function (e) {
e.success($scope.gridSource);
},
//...
},
//...
});
$scope.mainGridOptions = {
toolbar: ["excel"],
dataSource: $scope.gridData,
columns: [
{ field: "sektor", title: "Sektor", values: $scope.sectorData },
{ command: ["edit"], title: "Aktionen", width: "120px" }
]
};
});
}]);
的问题是,在最后一次通话,这应该填充网格,不能正常工作。该console.log
来电显示,数据加载,但网格不显示
您的文章帮助我明白了,什么地方出了问题检索数据。我的工厂已经退货了。我会很快更新我的问题,因为承诺问题似乎已经解决,但网格仍然无法加载。 – Marco