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

pushCreate and paging

3 Answers 116 Views
Grid
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 18 Jan 2016, 08:36 PM

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

3 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 21 Jan 2016, 08:18 AM

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!
 
0
James
Top achievements
Rank 1
answered on 11 Feb 2016, 02:27 PM

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..

0
Nikolay Rusev
Telerik team
answered on 15 Feb 2016, 10:01 AM

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!
 
Tags
Grid
Asked by
James
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
James
Top achievements
Rank 1
Share this question
or