I am facing two issues with virtual scrolling and server side pagig enabled on Grid.
1. As I drag the scrollbar, multiple posts are being made instead of a post happening after the scrollbar drag is completed.
For eg.,
Lets say my pagesize is 3000 and I have total 20000 rows. Onload, page 1 data is loaded. Now when I drag the scrollbar all the way to middle, there is a lag experienced in dragging and POST is happening in points of drag. There are 1 or 2 POSTS in the background and when the scrollbar eventually drops to the intended position, another POST happens and grid gets bound to the data returned from last POST.
2. Data loaded across multiple scrolls seem to get retained in the datasource. This is making the grid/page heavy and slow after using the scroll for some time. I have monitored the server POST. In the above example, once 6 POSTS have been made with returning the 20000 rows, scrolling doesnt create server posts. Data is being paged locally.
How do I reset datasource across page loads instead of appending the data recieved into the datasource ?
My grid config is as follows:
$("#grid").kendoGrid({
dataSource: {
type: "json",
serverPaging: true,
serverSorting: true,
pageSize: 3000,
allowUnsort: true,
transport: {
read: {
url: "homecontroller/action1",
type: "post",
contentType: "application/json; charset=utf-8",
dataType: "json"
},
parameterMap: function (options) {
return JSON.stringify(options); }
},
schema: { data: "Data", total: "TotalRowCount" }
},
groupable: true,
sortable: true,
pageable: true,
selectable: "multiple",
scrollable: {
virtual: true
},
columns:
[
//column definitions here
]
});