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

Kendo grid Datasource transport read for POST method making multiple ajax calls

1 Answer 1005 Views
Grid
This is a migrated thread and some comments may be shown as answers.
krishnan
Top achievements
Rank 1
krishnan asked on 19 Jul 2016, 08:17 AM

hi ,
I am using Kendo datasource transport read method in the read i am calling POST API but the API is getting called multiple times and also when the complete callback is called the API is infinitely called can you please give me the solution for this

Here is my transport function

var transportFunction = function(pageurl, reqObject) {
  return {
    read: {
      url: pageurl,
      contentType: "application/json; charset=utf-8",
      type: "POST",
      dataType: "json",
      beforeSend: function(xhr) {
          xhr.setRequestHeader('Authorization', token);
        }
    },
    parameterMap: function(options) {
      reqObject.PageSize = options.pageSize;
      reqObject.PageNum = options.page;
      var request = JSON.stringify(reqObject);
      return request;
    }
  }
}

and we are calling as below:

vm.gridOptions.dataSource.transport=transportFunction(apiUrl, reqObj);
vm.gridOptions.dataSource.schema.data="docDetailsArray"
vm.gridOptions.dataSource.schema.total="totalCount"

 

response from server:

{
demoDetails:[],
ErrorMsg:[],
Success: true,
docDetailsArray:[
    {list_of_keys_with_value1},
    {list_of_keys_with_value2},
    .....
    .....
  ]
};

 

Anyone face the same issue. can any body help me out why multiple xhr reqest are going

Thanks

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 21 Jul 2016, 06:36 AM
Hello,

There are not any known reasons for this problem. Could you provide either the full code that you are using or a runnable sample so I can investigate further?

Regards,
Daniel
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
Tags
Grid
Asked by
krishnan
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or