Assign Angular Scope Object Array to DataSource for Grid

2 posts, 0 answers
  1. James
    James avatar
    37 posts
    Member since:
    Sep 2014

    Posted 28 Sep 2015 Link to this post

    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.

  2. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 01 Oct 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
Back to Top