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

Refreshing the Pager

6 Answers 395 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brett
Top achievements
Rank 2
Brett asked on 17 Jan 2013, 07:38 PM
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.

6 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 18 Jan 2013, 08:28 AM
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!
0
Brett
Top achievements
Rank 2
answered on 18 Jan 2013, 02:44 PM
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.
0
Brett
Top achievements
Rank 2
answered on 18 Jan 2013, 04:33 PM
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.
0
Rosen
Telerik team
answered on 21 Jan 2013, 09:55 AM
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!
0
Yap
Top achievements
Rank 1
answered on 15 Jul 2017, 02:44 PM

Hi Rosen,

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

Thanks.

 

0
Preslav
Telerik team
answered on 18 Jul 2017, 12:24 PM
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.
Tags
Grid
Asked by
Brett
Top achievements
Rank 2
Answers by
Rosen
Telerik team
Brett
Top achievements
Rank 2
Yap
Top achievements
Rank 1
Preslav
Telerik team
Share this question
or