Refreshing the Pager

7 posts, 0 answers
  1. Brett
    Brett avatar
    25 posts
    Member since:
    Sep 2012

    Posted 17 Jan 2013 Link to this post

    Here's the scenario: I have a grid that uses a shared DataSource. I add new items to the DataSource programmatically, i.e. mySharedDataSource.add(new myItemModel()), when the user clicks an Add button. The pager updates the item count properly. Now, if the user clicks the Cancel button and I call mySharedDataSource.cancelChanges(), why does the pager not update to show the correct count? Calling the Grid's refresh() function does not correct the displayed count, even though the count of items in the shared DataSource is correct.

    It seems wasteful to me to call mySharedDataSource.read() just to update the pager count.
  2. Rosen
    Admin
    Rosen avatar
    3253 posts

    Posted 18 Jan 2013 Link to this post

    Hello Brett,

    I'm afraid that I'm unable to recreate such behavior locally. Therefore, could you please provide a test page in which this issue can be observed.

    Regards,
    Rosen
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Brett
    Brett avatar
    25 posts
    Member since:
    Sep 2012

    Posted 18 Jan 2013 Link to this post

    Here is a mock up that represents what I'm doing, http://jsfiddle.net/V2QsW/, but, alas, it works like it's supposed to. So, obviously there's something I'm doing wrong in my script that's borking it up.
  4. Brett
    Brett avatar
    25 posts
    Member since:
    Sep 2012

    Posted 18 Jan 2013 Link to this post

    I figured out what is causing the issue for me. I have serverPaging set to true on the DataSource. This basically means I have to call DataSource.read() to get the pager to update. I don't want to have to do that in the scenario I described above. Since the user is cancelling the addition of a new record to the Grid, there should be no need to read from the database again. I would like the default behavior of the Pager to do what I'm asking, but since that doesn't occur, how can I update the Pager display manually?

    Here is the same jsFiddle example with serverPaging set to truehttp://jsfiddle.net/V2QsW/1/. Add a new record and then click Cancel. The pager count does not update appropriately.
  5. Rosen
    Admin
    Rosen avatar
    3253 posts

    Posted 21 Jan 2013 Link to this post

    Hello Brett,

    We were able to find the cause for the issue you have described and to address it. The fix will be available in the next internal build. Meanwhile I have updated your telerik points.

    Regards,
    Rosen
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. Yap
    Yap avatar
    1 posts
    Member since:
    Oct 2013

    Posted 15 Jul 2017 in reply to Rosen Link to this post

    Hi Rosen,

    Is the fix available and can you share how to fix that?

    Thanks.

     

  7. Preslav
    Admin
    Preslav avatar
    583 posts

    Posted 18 Jul 2017 Link to this post

    Hi Yap,

    This faulty behavior is no longer reproducible.

    Please, check the example with the latest KendoUI files:
    Regards,
    Preslav
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top