SSayee
SSayee

Reputation: 95

Dgrid-OnDemandGrid Virtualscrolling

I am using Dgrid OndemandGrid with Jsonrest store.On scrolling,I am taking 40 records from the database.

                     var grid= new OnDemandGrid({

                store: jsonstore,
                columns: Layout,
                minRowsPerPage : 40,
                maxRowsPerPage : 40,
                loadingMessage: "Loading data...",
                noDataMessage: "No results found."
            }, "grid");

On first time ,I am getting the response Header as Content-Range items=0-39/132 .On further scrolling ,the response Header is Content-Range items=38-78/132 instead of 40-79/132.

Can someone tell me how to get the response as 40-79/132 , 80-119..etc..

Upvotes: 0

Views: 294

Answers (1)

Ken Franqueiro
Ken Franqueiro

Reputation: 10559

Add queryRowsOverlap: 0 to the object you're passing to the grid constructor.

queryRowsOverlap defaults to 1, and is the reason the queries overlap. This property is intended to counteract issues with dojo/store/Observable "dropping" items at page boundaries, though it isn't a perfect solution.

Upvotes: 1

Related Questions