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

[Solved] How to implement serverPaging with angularjs and webApi

1 Answer 226 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Saad
Top achievements
Rank 1
Saad asked on 03 Apr 2015, 07:57 AM
I am trying to implement serverPaging sorting by using Webapi.
I use angularjs in UI side.

i have implemented server side code. which accept kendoRequest and returns kendoResponse.
it returns data as well.
but grid trying to load it throughs undefined is not a function, i have attached screenshot of error.

here is my code

 $scope.mainGridOptions = {
        columns:["Country","RiskReference"],
        dataSource: new kendo.data.DataSource({
            transport: {
                read: {
                    url: serviceBase + "api/Policy/GetPolicyPage/" + $scope.policyId,
                    type: "POST",
                    contentType: "application/json"
                },
                parameterMap: function (options, operation) {
if (operation === "read") {
  
return kendo.stringify(options);
                    }
                            
              return options;
                }
            },
            pageSize: 10,
            serverPaging: true,
            serverSorting: true
        }),
        sortable: true,
        pageable: true,
        resizable: true,
        selectable: "single cell",
        editable: "popup",
        schema: {
         
         data:"Data",
      
         total: "Count"
        },error: function (e) {
            console.log(e.statusText);
        }
    };



See attached file for data format return from my webapi service.

please review my code, is there anything am i missing?

regards,
Saad

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 06 Apr 2015, 01:20 PM

Hello Saad,

The problem here is that the schema is part of the data source configuration. In the provided code the schema is part of grid configuration. 

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