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

Trigger the loading status on the grid by javascript

Hi There,

I'm following an example that works perfect when I want to update the dataSource with a DataManager. The only issue is that I want to trigger the loading status of the ejGrid in the meantime that we are waiting for the answer.

example

Javacript:

     var vehicleId = event.data.VehicleCode;
     var auditTable = $("#<%= gvVehicleAudit.ClientID%>").ejGrid("instance");
     var query = new ej.Query();
     query.addParams("vehicleId", vehicleId);

var dataManager = ej.DataManager({ url: "VehicleBenefitsNew_N.aspx/vehicleAudit", crossDomain: true, adaptor: new ej.WebMethodAdaptor() });

var promise = dataManager.executeQuery(query);

// trigger loading on ejGrid

promise.done(function (e) {
                auditTable.dataSource(e.result);
            });

Many thanks in advance!

Kind Regards.

Nestor Ochoa


1 Reply

VN Vignesh Natarajan Syncfusion Team February 19, 2019 10:34 AM UTC

Hi Nestor, 
 
Thanks for using Syncfusion products. 
 
Query: “The only issue is that I want to trigger the loading status of the ejGrid in the meantime that we are waiting for the answer” 
 
From your query, we understand that you need to display the waiting popup in ejGrid. we suggest you to achieve your requirement by showing and hiding the waiting popup from the Grid instance. 
 
Refer the below code example 
 
  var vehicleId = event.data.VehicleCode; 
     var auditTable = $("#<%= gvVehicleAudit.ClientID%>").ejGrid("instance"); 
     var query = new ej.Query(); 
     query.addParams("vehicleId", vehicleId); 
 
var dataManager = ej.DataManager({ url: "VehicleBenefitsNew_N.aspx/vehicleAudit", crossDomain: true, adaptor: new ej.WebMethodAdaptor() }); 
 
var promise = dataManager.executeQuery(query); 
 
auditTable.element.ejWaitingPopup("show"); 
// trigger loading on ejGrid 
 
promise.done(function (e) { 
    auditTable.dataSource(e.result); 
    auditTable.element.ejWaitingPopup("hide"); 
            }); 
 
Please get back to us if you have further queries.   
 
Regards, 
Vignesh Natarajan 
 


Loader.
Up arrow icon