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

2 posts, 0 answers
  1. Luke
    Luke avatar
    3 posts
    Member since:
    Apr 2009

    Posted 12 Mar 2013 Link to this post

    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.
  2. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 14 Mar 2013 Link to this post

    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!
Back to Top