We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Wrong DataManager Skip Value When EnableVirtualization is True

I've got a large data set, and I am performing remote data binding using a UrlAdaptor and enabledVirtualization = true. 

Upon initial fetch, the server-side DataManager object has a Skip value of 0 and Take value of 80 (as expected). 

When the first "virtualscroll" event is fired, the server-side DataManager object has a Skip value of 0 and Take value of 160 - this should be 80 and 160. This is causing the first 80 rows to be duplicated. Upon inspection of the arguments in the "actionBegin" event, the startIndex is 80 and the endIndex is 160, which seems correct.

When the second "virtualscroll" event is fired, the server-side DataManager object has a Skip value of 160 and Take value of 80 (as expected). Subsequent "virtualscroll" events are working as expected as well.

    self.dmSearch = ej.DataManager({
        url: "/v2/patients/GetPatients",
        adaptor: new ej.UrlAdaptor
    });

    self.ejConfig = function () {
        $('#searchPatientsGrid').ejGrid({
            dataSource: self.dmSearch,
            actionBegin: function (args) {
                console.dir(args);
            },
            columns: [
                { field: "Rank", headerText: "Rank", width: 50, textAlign: ej.TextAlign.Center },
                { field: "PatientId", headerText: "PID", width: 50, textAlign: ej.TextAlign.Center },
                { field: "FirstName", headerText: "First Name", width: 150 },
                { field: "LastName", headerText: "Last Name", width: 150 },
                { field: "Facility", width: 250 },
                { field: "Age", width: 50, textAlign: ej.TextAlign.Center },
                { field: "Sex", width: 75 },
                { field: "Program", width: 75 },
                { field: "ActivityCount", headerText: "Activities", width: 75, textAlign: ej.TextAlign.Center },
                { field: "ActivitiesPastDueCount", headerText: "Past Due", width: 75, textAlign: ej.TextAlign.Center },
                { field: "AssignedTo", headerText: "Assigned To", width: 200 }
            ],
            isResponsive: true,
            enableResponsiveRow: true,
            gridLines: ej.Grid.GridLines.Horizontal,
            allowScrolling: true,
            scrollSettings: { width: "auto", height: 500, enableVirtualization: true, allowVirtualScrolling: true },
            allowFiltering: true,
            allowSorting: true,
            sortSettings: { sortedColumns: [{ field: "PatientId" }]},
            allowMultiSorting: true,
            toolbarSettings: { showToolbar: true, customToolbarItems: [{ templateID: "#refreshGrid" }] },


3 Replies

MA Matt Abercrombie December 28, 2016 10:14 PM UTC

*Correction: It should be Skip 80 and Take 80 (not 160) in the first "virtualscroll" event.


SA Saravanan Arunachalam Syncfusion Team January 3, 2017 09:32 AM UTC

Hi Matt, 
Thanks for contacting Syncfusion’s support. 
The reported issue “Skip value is not passed correctly when scroll first time” has been reproduced at our end. So, we have considered this as the defect and the fix for this issue will be included in the Volume 1, 2017 release which will be expected to be rolled out by the mid of February 2017. 
And also we have resolved the issue using a workaround. In the workaround, we have achieved your requirement using “actionComplete” event of ejGrid control and please refer to the following code example. 
var dataManager = ej.DataManager({ url: "/Home/DataSource", adaptor: new ej.UrlAdaptor() }); 
$("#Grid").ejGrid({ 
            dataSource: dataManager, 
            actionComplete: function(args){ 
                if (args.requestType == "sorting" || this.model.sortSettings.sortedColumns.length>0) { 
                    this._needVPaging = false; 
                } 
            }, 
     }); 
 
Regards, 
Saravanan A. 



SA Saravanan Arunachalam Syncfusion Team February 13, 2017 12:07 PM UTC

Hi Matt, 
We are glad to announce that our Essential Studio 2017 Volume 1 is rolled out and it’s included the fix for the issue Skip value is not passed correctly when scroll first timeis available for download under the following link. 
 Please get in touch with us if you would require any further assistance. 
Regards,                  
Saravanan A. 


Loader.
Live Chat Icon For mobile
Up arrow icon