Server Side paging configuration

2 posts, 0 answers
  1. Peter
    Peter avatar
    4 posts
    Member since:
    Aug 2013

    Posted 26 Sep 2018 Link to this post

    I've got an application where I'm using a Kendo UI Grid widget. I know that it will, at some time in the future, be dealing with a large number of records. I'm implementing server-side paging and I'm getting the expected result from the server.

    • I have page size set to 12.
    • I currently have a total of 18 records, resulting in two pages.
    • Page 1 displays 12 records and shows the page navigation as expected.
    • When I click next to navigate to page 2, I get a blank list.

    With regards to page 2, I see my data endpoint returning 6 records as expected. From what I can tell, the Grid is binding them to page one, instead of showing them on page 2. 

    Is there a way to tell the grid which page you are returning results for (through the schema or programmatically)? Or is my only option to use local storage and append my results to that local storage?

    I've worked around this in the past by returning all the results up to the offset since I know large datasets will be filtered with a keyword search, but I'd rather find a way to display the results through paging so I can implement filtering.

  2. Stefan
    Admin
    Stefan avatar
    3008 posts

    Posted 28 Sep 2018 Link to this post

    Hello, Peter,

    Thank you for the details.

    This may occur if the total in the second response is set only to 6. This will tell the Grid that there are only 6 records on the server and all of them are here.

    The schema.total has to be set:

    https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/serverpaging

    This will eliminate the need to show that there are more than 1 more.

    Please check our demo with server operations and observe how the total is part of the response:

    https://demos.telerik.com/kendo-ui/grid/remote-data-binding

    If the issue still occurs, please share with us the response returned from the server.

    Regards,
    Stefan
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top