actionCompleted event doesn't get fired in Gantt

Hello,
We are facing a weird issue with actionCompleted event,  we see that our data is displayed correctly on the Gantt always but this actionCompleted event is not being fired consistently. In some cases we see the events, some cases we don't see it, especially when we move between tabs in our application. And also actionFailure events doesn't log anything.

We are just wondering if there is any alternative to the actionComplete (type:refresh) event to make sure we can close a spinner after the data is populated on a syncfusion gantt component? We have tried to close our spinner by listening to the databound or created event but the spinner closes before data is displayed. 

Thanks,

Minh

3 Replies 1 reply marked as answer

GM Gopinath Muniraj Syncfusion Team January 22, 2021 10:41 AM UTC

Hi Minh,  
Thanks for contacting Syncfusion support.  
We have analyzed your query. The actionComplete event is not triggered while rendering the Gantt. And the actionFailure event is triggered only when the Gantt couldn’t get the data from the remote.  
Do you want to render a spinner till the data is loaded?  
Actually, the default spinner is rotating until the Gantt is rendering completely. If we want to load the spinner event after the databound event, we can use the setTimeout method. Here we started the spinner in created event and stopped in the databound event. Please refer the below code snippet,  
created(args: any) { 
  let ganttObj = document.getElementById('ganttDefault').ej2_instances[0]; 
  ganttObj.hideSpinner(); 
  ganttObj.treeGrid.grid.hideSpinner(); 
  createSpinner({ 
            // Specify the target for the spinner to show 
            target: document.getElementById("container") 
  }); 
  this.showSpinner(); 
} 
dataBound (args: any) { 
  setTimeout(function () { 
            //this.hideSpinner(); 
            hideSpinner(document.getElementById("container")); 
  }, 1000);     
}; 
public showSpinner() { 
  // showSpinner() will make the spinner visible 
  showSpinner(document.getElementById("container")); 
} 
public hideSpinner() { 
  // hideSpinner() method used hide spinner 
  hideSpinner(document.getElementById("container")); 
} 
   
We have prepared a sample for your reference. In this example, also we can start and stop the spinner using external buttons. Please get the sample from below link.  
Please let us know if you need any further details on this.  
Regards,  
Gopinath M 


Marked as answer

MD Minh Dong January 24, 2021 04:23 PM UTC

Thank Gopinath, we will give it a try


GM Gopinath Muniraj Syncfusion Team January 25, 2021 03:20 AM UTC

Hi Minh, 
You are welcome! 
Thanks for the update. We will wait to hear from you. 
Regards, 
Gopinath M 


Loader.
Up arrow icon