Open Editor automatically after Schedule has loaded it's data

Hi,

I have a requirement to open the Editor window after the Schedule has loaded it's data from remote services. (Both the events and resources data are coming from remote services)

this.scheduleObj.openEditor(eventData, "Add", true);

 I tried running the command above on the schedule's "created" event but as soon as the data from either of the remote services is retrieved the Schedule is redrawn and the Editor window disappears.

I also tried running that command in the "dataBound" event but it gets called twice, first when the resources data is bound and second when the events data is bound.  This causes the Editor window to be shown after the resources data is bound, then immediately the window is removed, then it is shown a second time when the events data is bound to the Schedule.  

Any suggestions how I may show the Editor window after all data is loaded into the Schedule?

thanks

Derrick






1 Reply 1 reply marked as answer

RV Ravikumar Venkatesan Syncfusion Team February 8, 2021 12:47 PM UTC

Hi Derrick, 

Greetings from Syncfusion support. 

We have validated your requirement at our end and achieved it with the help of the dataBound event and for the same, we have prepared a sample that can be downloaded from the below link. 


[app.component.ts] 
  public onDataBound(args) { 
    if (this.isInitialRendering) { 
      let cell = this.scheduleObj.element.querySelector(".e-work-cells"); 
      let data: any = this.scheduleObj.getCellDetails(cell); 
      data = { 
        Subject: "Test", 
        StartTime: data.startTime, 
        EndTime: data.endTime, 
        GroupID: this.scheduleObj.getResourcesByIndex(data.groupIndex).groupData 
          .GroupID 
      }; 
      this.scheduleObj.openEditor(data, "Add", true); 
      this.isInitialRendering = false; 
    } 
  } 

Kindly try the above sample and get back to us if you need any further assistance. 

Regards, 
Ravikumar Venkatesan 


Marked as answer
Loader.
Up arrow icon