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.
Unfortunately, activation email could not send to your email. Please try again.

Wrong DataManager Skip Value When EnableVirtualization is True

Thread ID:

Created:

Updated:

Platform:

Replies:

128054 Dec 28,2016 05:10 PM Feb 13,2017 07:07 AM JavaScript 3
loading
Tags: ejGrid
Matt Abercrombie
Asked On December 28, 2016 05:10 PM

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" }] },


Matt Abercrombie
Replied On December 28, 2016 05:14 PM

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

Saravanan Arunachalam [Syncfusion]
Replied On January 3, 2017 04:32 AM

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. 


Saravanan Arunachalam [Syncfusion]
Replied On February 13, 2017 07:07 AM

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. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;