我使用Restangular来解析响应(产品列表)...我知道这个问题已经解决了。Kendo-UI Grid不通过AngularJS呈现数据
我是Kendo-UI的新手。但是已经建立了如下的基本测试网格。我正在使用k-rebind,因为产品阵列在创建网格时可能未解决。
<kendo-grid k-options="mainGridOptions" k-rebind="products"></kendo-grid>
在我的控制器:
$scope.products = [];
$scope.therapyAreas = [];
$scope.dropDownTAs = [];
prProductService.getProducts().then(function(products) {
$scope.products = products;
prTAService.getTAs().then(function(tas) {
$scope.therapyAreas = tas;
for(var i = 0; i < $scope.therapyAreas.length;i++) {
$scope.dropDownTAs.push({id: $scope.therapyAreas[i].id, therapyArea: $scope.therapyAreas[i].therapyArea});
}
});
});
$scope.mainGridOptions = {
dataSource: {
data: $scope.products
},
height: 550,
scrollable: true,
sortable: true,
filterable: true,
pageable: {
input: true,
numeric: false
},
columns: [
"productName",
"activeIngredients",
"productComments",
"gpt",
"ta"
]
};
}])
我知道正在返回数组的产品,我还以为K-重新绑定会看产品阵列更改,所以当它解决它刷新UI ...没有这样的运气。
我已经尝试在数据源中手动排列数组以反映产品数组的响应,并且网格工作正常。
问候
我
您好,感谢......是不是从那个链接很明显,你必须:
在相位控制器:
在HTML视图代码绑定到选项。它只是说,你需要绑定到范围内的东西,你需要看......我做了什么。会给这个去,欣赏的回应.... – smackenzie 2014-10-08 18:27:20
不用担心!如果这仍然行不通,请告诉我更长的时间/完整:) – carlbergenhem 2014-10-08 18:54:54
在angularJs世界中,虽然可以绑定到一个空数组,但它应该被自动监视和刷新,这个级别的数据绑定不会发生在Kendo UI中呢? – smackenzie 2014-10-09 13:51:27