Reputation: 7353
How to produce kendo-grid
with different data for each iteration of ng-repeat
?
HTML code:
<div ng-repeat="PricesPerGroup in AllGroups">
<kendo-grid options="GridOptions"></kendo-grid>
</div>
JavaScript code:
$scope.GridOptions = {
dataSource: {
data: {
(data is current 'PricesPerGroup' - Should bring it from ng-repeat)
}
}
}
Upvotes: 3
Views: 1219
Reputation: 193311
Try to use helper function that would return proper config object:
<div ng-repeat="PricesPerGroup in AllGroups">
<kendo-grid options="getGridOptions(PricesPerGroup)"></kendo-grid>
</div>
And in controller:
$scope.getGridOptions = function(data) {
return {
dataSource: {
data: data
}
};
};
Demo: http://dojo.telerik.com/eFaXA
Upvotes: 7