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

Manually set total records in Kendo Grid

3 Answers 1421 Views
Grid
This is a migrated thread and some comments may be shown as answers.
manpreet
Top achievements
Rank 1
manpreet asked on 10 Nov 2014, 08:43 AM
Hi there,

I have a requirement where a large dataset is processed at backend in batches. As soon as first batch is processed, I get a notification on client end and I request the data to be binded to grid. All works good here, total records are shown correctly.

The problem starts when I get second notification. My requirement is to update only the total number of items shown in bottom of grid and accordingly update the pages shown in pager of kendo grid. If I make a second transport call, it updates the total number correctly but also refreshes the data on grid, so grid keeps on refreshing itself.

Is there anything I can do to directly update the pager of kendo grid ?

3 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 12 Nov 2014, 08:16 AM
Hi Manpreet,

The total in the pager is linked to the total property of the Kendo UI Grid, so in order to update its value the total of the dataSource should be updated as well.  However changing the total of the dataSource will trigger its change event which will lead to refreshing the grid.

If you do not want to change refresh the grid then you can manually update the value on the bottom of the grid using jQuery.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
manpreet
Top achievements
Rank 1
answered on 13 Nov 2014, 10:33 AM
@Kiril - Thanks Kiril, I have already tried that, but the issue is there are lot of things that need to be manipulated using jquery, pager, total items, click event does not work for dynamically added pages. I was looking for a simple approach.
0
Kiril Nikolov
Telerik team
answered on 17 Nov 2014, 08:13 AM
Hi Manpreet,

Well there is no other approach, as the total in the pager is connected to the total of the dataSource, so in order to show a different value - you will need to set it manually.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
manpreet
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
manpreet
Top achievements
Rank 1
Share this question
or