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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Create event by calling method in .ts

Thread ID:

Created:

Updated:

Platform:

Replies:

145202 Jun 12,2019 08:52 AM UTC Jun 20,2019 03:17 AM UTC Angular - EJ 2 3
loading
Tags: Schedule
chevron
Asked On June 12, 2019 08:52 AM UTC

Hello,

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 !

TS
onPopupOpen(args: PopupOpenEventArgs): void {

          args.selectedDate ?
   // Create event:
          ?????
}

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

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

Nevitha Ravi [Syncfusion]
Replied On 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. 

Regards, 
Nevitha 


chevron
Replied On June 19, 2019 01:23 PM UTC

Thanks a lot for your answer !


Karthigeyan Krishnamurthi [Syncfusion]
Replied On June 20, 2019 03:17 AM UTC

Most welcome 😊 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon