Kendo-ui-core: Dynamic Total count not working in Manual grid scroll

Created on 26 Nov 2019  路  11Comments  路  Source: telerik/kendo-ui-core

I am a beginner of kendo ui grid.
I am trying to manipulate the total count of grid dynamically. It works as i expected, but the problem is when i drag the scroll bar to bottom , dynamic total count got messed.

Here is my code

image

Please help me with this issue.
Thanks in advance.

Grid Pager

Most helpful comment

you need to make paging on server side then it may possible to improve grid performance. all pagination and total count logic has to move on back-end and in ui you will just get few records and total count.

there is also asyn provide by kendo ui. you can also try if it helps other wise you have to move your code to back-end.

All 11 comments

It is good to stop incrementing the recordCount when it reaches the last data record.
Maybe adding some more conditional statements like these will help:

if ((data.length recordCount = (recordCount > pageSize) ? recordCount + data.length : data.length;
else
if (recordCount>=data.__count)
recordCount = recordCount; //Trying to stop incrementing the number of records count
else
recordCount += (recordCount == 0 ) ? pageSize + data.length : pageSize;

If you have found the solution, please close the ticket.

Do the proposed changes solve your problem? If not could you share a runnable sample (dojo)?

Sorry for delayed reply,
Thanks @dmanova for your solution.

In virtual scrolling of remote data, How can i get a accurate value of _count that matches the remote data(All Records in the table) by using increment recordcount. Is there a way to implement virtual scrolling of remote data without getting total count from API & increment recordcount. If its possible please share a runnable demo.

@Ram-97 have you tried Kendo's pager widget? Maybe it will help you achieve what you intend.
You could use it as part of the Grid (with pageable: true ) or as a separate widget as shown in https://dojo.telerik.com/oHuzEtOv

Thanks for your suggestion.
Changing the pagination to infinite scroll was my primary thing.
I had successfully implemented the scrolling using the endless scroll. But endless scrolling makes the grid performance slow.
This is the case where the grid performance gets slow.
In my table, i am having 300k records.
when the grid appending more than 10k records. Grid performance gets slow.
Is there any way to make the grid performance normal.

you need to make paging on server side then it may possible to improve grid performance. all pagination and total count logic has to move on back-end and in ui you will just get few records and total count.

there is also asyn provide by kendo ui. you can also try if it helps other wise you have to move your code to back-end.

Thanks @vishal079.
But I need total count without using backend

if you need good performance with 300k records without using backend then you can try

async: false

The kendo grid will automatically get count for you.

And performance will be dependent on clients the system configuration. if the system with high configuration then it will not take much time to load.

Also find below link may help you with same scenario.
https://stackoverflow.com/questions/20032466/how-can-i-set-the-total-number-of-data-items-in-my-grid-using-a-function

@vishal079 But its like getting the count from API.
In my case,Getting the count from API will take more than 30 secs. Because My data is growing too fast.
For 10 secs-More than 1000 records are inserted in my table.
In this case, It will be not possible to get the count from API itself. But virtual scrolling of remote data works on Count.

Please help me with grid performance in endless scroll.

@Ram-97 You can set paging with virtual scrolling, it will help you to improve grid performance. also you can use row-databound event to manipulate data at the time of grid binding.

if you have api with large data then share i will create example to improve kendo grid performance.

Thanks @vishal079 .
Sorry for delayed reply,
This is my case:
I am having a table with 200k records. As you know, default timeout for query is 30 seconds in .net.
I am not allowed to use the commandTimeout property, because the table data size will grow in each minute. Even if we using the commandTimeout property will be waste for my requirement.

Note: As you know,virtual scroll requires total count from Api. I have managed to manipulate the total count from web itself (without using Api). But my actual problem was, when i used dragging scroll option to scroll the grid, total count got messed.

Patiently waiting for your reply @vishal079 .

Was this page helpful?
0 / 5 - 0 ratings