pushCreate and paging

4 posts, 0 answers
  1. James
    James avatar
    5 posts
    Member since:
    Jun 2014

    Posted 18 Jan 2016 Link to this post

    Hello,

    We have app that uses server-side paging along with client updates supplied via SignalR. Currently, we refresh the grid from the server when an update comes in from SignalR. Due to bandwidth considerations we'd really like to do a pushCreate with the data received from SignalR and avoid the dataset load. This pretty much works, but the pushCreate doesn't drop the last record from the page to make room for the new one, which causes the grid to continue to expand. Simply deleting the last record messes up the total record count.

    This fiddle demonstrates the pushCreate behavior: https://jsfiddle.net/jiander/hx7g0Lyo/

    Is there some trick to keep the paging clean when using pushCreate?

    Regards,

    Jim

  2. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2289 posts

    Posted 21 Jan 2016 Link to this post

    Hello James,

     

    We are not sure what you mean here - ` the pushCreate doesn't drop the last record from the page to make room for the new one`. Can you please clarify.

     

    I see in the example that adding items updated to total pages correctly. pushCreate will add items to the current data, which in the case of serverPaging will be current page data.

     

    Regards,
    Nikolay Rusev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. James
    James avatar
    5 posts
    Member since:
    Jun 2014

    Posted 11 Feb 2016 in reply to Nikolay Rusev Link to this post

    Hi Nikolay,

    Sorry for the slow reply. Got pulled into another project and wasn't able to follow up. 

    What I meant by dropping the last record is that as records are added using pushCreate the grid will continue to grow past the specified page size. Using the fiddle as an example, click Add four times. The result is six rows displayed in the grid with a correct total record count, yet the record count displays 1-5 (see attachment). What I'd like to do is limit the number of rows in the grid to the page size regardless of how many times pushCreate is called..

  4. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2289 posts

    Posted 15 Feb 2016 Link to this post

    Hello James,

     

    I see what you mean now. This behavior however is expected. It is essentially the same as if you define some page size (with serverPaging: true)  and the server returns more items (for the current page) than the page size. The Grid will show then and the pager will be out of sync. 

     

    Regards,
    Nikolay Rusev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top