How to trigger actionComplete event manually?

I have a situation where I need to trigger this event manually:

https://ej2.syncfusion.com/vue/documentation/api/gantt/#actioncomplete

For example, like this:

actionComplete: function (args) {
switch (args.requestType) {
...
case 'refresh': {
// I want to trigger this code manually
// ...
// do something ...
break
}
}

Perhaps I need to do something like this?

const gridObj = document.getElementById(self.objectID).ej2_instances[0]
gridObj.actionComplete({requestType: 'refresh'})


Please give me the right code to do it. Or if it doesn't exist yet, what should I do?


1 Reply

PS Premkumar Sudalaimuthu Syncfusion Team June 3, 2022 10:25 AM UTC

Hi Meidika ,


We have prepared a sample for triggering the actionComplete event manually in refresh requestType. In the below sample we have set an alert message while refresh requestType is triggered in actionComplete event. Please refer to the below code snippets and sample for more reference.


Code snippets:


 

  <ejs-button id="selectRow" cssClass="e-info" v- on:click.native="select">Refresh</ejs-button>

 

actionComplete: function (args) {

    if (args.requestType == 'refresh') {

      alert('Refresh');

 

},

select: function(e){

    

      var ganttObj = document.getElementById('GanttContainer').ej2_instances[0];

  ganttObj.actionComplete({requestType:'refresh'});

  },

 

 



Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Refreshvue-172267909


Regards,

Premkumar S


Loader.
Up arrow icon