How to use Kendo grid in Angular -ngRepeat

How to create kendo-grid

with different data for each iteration 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)
        }
    }
}

      

+3


source to share


1 answer


Try using a helper function that will return the correct config object:

<div ng-repeat="PricesPerGroup in AllGroups">
    <kendo-grid options="getGridOptions(PricesPerGroup)"></kendo-grid>
</div>

      

And in the controller:



$scope.getGridOptions = function(data) {
    return {
        dataSource: {
            data: data
        }
    };
};

      

Demo: http://dojo.telerik.com/eFaXA

+7


source







All Articles