This is a migrated thread and some comments may be shown as answers.

Assign Angular Scope Object Array to DataSource for Grid

1 Answer 133 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 28 Sep 2015, 06:40 PM

I am trying to assign an angular scope object array to a DataSource item.  Below is what I have tried.

$scope.getWaivers = function () {
            waiverService.getCustomers($scope.model.customer.CustomerID).then(function (result) {
                $scope.model.waivers = result.data;
                $scope.model.dataSource = new kendo.data.DataSource({
                        pageSize: 15,
                        autoSync: true,
                        autoBind: false,
                        data: $scope.model.waivers,
                });
                $scope.model.dataSource.read();
                }
 
            });
        };

 

$scope.surchargeGridOptions = {
    dataSource: $scope.model.dataSource,
  
 . . .
}

I can get everything to work using the transport read calls but I want to be able to make changes and add items locall without going back to the server data source.

1 Answer, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 01 Oct 2015, 05:57 AM

Hello James,

 

I am sorry for the delayed response, we had a release yesterday. If I understand your case correctly, you may use the datasource data() method for that purpose.

 

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Data Source
Asked by
James
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Share this question
or