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

ejGrid via a datamanger calling Web API Get method twice after a requery

I am populating an ejGrid via a datamanger and find that when I run the search query a second and third time etc it calls my Web API Get method twice.  When I run the query the first time it only calls the Get method once.  Do I need to clear the data from the grid before a new query occurs? Will this prevent the Web API Get method being called twice?   I tried clearSearching and gridObj.refreshContent() but these returned client side errors.  The code I am using is below.  Note that the rest of the client side function does not call the Web API Get method.  This only occurs as per below:

            var dataManager = ej.DataManager({
                url: urlStr,
                enableCaching: false,
                crossDomain: true,
                adaptor: new ej.WebApiAdaptor(),
                offline: true
            });

            $("#Grid").ejGrid({
                dataSource: dataManager,
                recordDoubleClick: function (args) { SelectedRow(args, archiveURLPath) },
                // selectionType: "multiple",
                allowPaging: true,
                pageSettings: { pagesize: 12 },
                actionComplete: function (args) {

                    var gridObj = $("#Grid").ejGrid("instance");
                    if (args.requestType == "refresh" && flag == true) {
                        flag = false;
                        gridObj.hideColumns("Id");
                    }
                }
            });




1 Reply

RU Ragavee U S Syncfusion Team December 23, 2016 09:40 AM UTC

Hi Stephen, 

We have created a grid sample with the provided code sample and the issue is not reproducible at our end. Please find the sample and video demo in below location. 


Also, we could see that you have defined the offline property of the ejDataManager as true which on enabling loads the data in offline mode. With offline as true, the DataManager requests the server only once and further data manipulation operation can be done at client side itself. Thus, no other post request will occur on performing any operation in grid. 

So, please try the above sample and if you still face any issues, please share the following information. 

1.       On what action, the re-query triggers the WebAPI Get method? 
2.       Clear replication procedure 
3.       Video demo of the issue 
4.       If possible, please reproduce the issue in the above provided sample and share. 

Regards, 
Ragavee U S. 


Loader.
Up arrow icon