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
close icon

Create event by calling method in .ts


i'd like to create my own popin to create or edit an event by using my own method in the typescript file of my component, and i'm also asking me how to get the date clicked in the args of my method ?

Here is a sample of my code:

Thanks by advance !

onPopupOpen(args: PopupOpenEventArgs): void {

          args.selectedDate ?
   // Create event:

.e-popup.e-popup-open {
// in order to not use the default popin
//display: none;

<ejs-schedule #scheduleObj id='schedule' width='100%' cssClass='timeline-resource-grouping' [selectedDate]="selectedDate"
[group]="group" [eventSettings]="eventSettings" (actionBegin)="onActionBegin($event)" (popupOpen)="onPopupOpen($event)">

3 Replies

NR Nevitha Ravi Syncfusion Team June 13, 2019 06:17 AM UTC

Hi Chevron, 

Greetings from  Syncfusion Support. 

We could prevent the default popup opening by setting args.cancel= true within popupOpen event and get the date in args.data. We have prepared sample for your reference which can be available in the following link. 

   onPopupOpen(args: PopupOpenEventArgs): void { 
      if (args.type === "Editor") { 
        let srtTime = (args.data as any).StartTime; // To get the start time value 
        let endTime = (args.data as any).EndTime; // To get the end time value 
        console.log("StartTime: " + srtTime + " and endTime: " + endTime); // To display the time in console 
        // args.cancel = true; // To disable the default editor window 

Kindly try out the above sample and let us know if need any further assistance. 


CH chevron June 19, 2019 01:23 PM UTC

Thanks a lot for your answer !

KK Karthigeyan Krishnamurthi Syncfusion Team June 20, 2019 03:17 AM UTC

Most welcome 😊 

Live Chat Icon For mobile
Up arrow icon