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

Calling datasource.read(data) will delete .pageSize property when serverPaging is not enabled

1 Answer 58 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Luke
Top achievements
Rank 1
Luke asked on 12 Mar 2013, 11:51 PM
If I have a data source on with serverPaging: false and the following object:
var params =
{
"date""2013-03-13T07:00:00.000Z",
"region":0,
"pageNumber":1,
"pageSize":10,
"sortBy":0,
"sortOrder":0
};
When I call
myDataSource.read(params),
the pageSize property is removed from my params object. This is due to line 6817 in kendo.all.js, version 2013.3.1315, highlighted below:
if (!that.options.serverPaging) {
     delete options.take;
     delete options.skip;
     delete options.page;
     delete options.pageSize;
}
I would love to set serverPaging: true and avoid the running of this code, but it causes an infinite loop, continuously requesting reloading of my data from the server, so I must set it false. I do not have the time to post about that separate problem unfortunately, but it is very concerning. Regardless, seems like properties on user-created data objects being passed to the .read() method should never be deleted.

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 14 Mar 2013, 04:03 PM
Hello Luke,

After all the parameters are send to the server through the $.ajax function as data parameter.

By  coincidence pageSize  happens to be a reserved word under which the pageSize is send to the server. To avoid its removing by our script change the name of the variable from pageSize to something else.

Sorry for that inconvenience.

Kind Regards,
Petur Subev
the Telerik team
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
Luke
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or