Hi Juan,
Greetings from Syncfusion support.
Based on your requirement we have prepared the below sample with the help of popupOpen and eventRendered event of the Schedule.
Q1: How to disable opening of editor window for the type ‘A’ event
Step 1: Add custom field called ‘EventType’ to the events like the below.
dataSource: [{
Id: 1,
Subject: 'Type A event',
Location: 'Space Centre USA',
StartTime: new Date(2019, 0, 6, 9, 30),
EndTime: new Date(2019, 0, 6, 11, 0),
CategoryColor: '#1aaa55',
EventType: 'A
}, {
Id: 2,
Subject: 'Type B event',
Location: 'Newyork City',
StartTime: new Date(2019, 0, 7, 12, 0),
EndTime: new Date(2019, 0, 7, 14, 0),
CategoryColor: '#357cd2',
EventType: 'B'
}]
Step 2: Bind the popupOpen event to the Angular schedule like the below.
<ejs-schedule #scheduleObj height='650px' [(selectedDate)]="selectedDate" [eventSettings]="eventSettings"
(popupOpen)='onPopupOpen($event)' (eventRendered)='onEventRendered($event)'>
</ejs-schedule>
Step 3: Add the definition for the poupOpen event like the below.
public onPopupOpen(args: PopupOpenEventArgs) {
// Disable the opening of editor window when event click
if ((args.data as any).EventType === 'A' && !isNullOrUndefined(args.target) && args.target.classList.contains('e-appointment') && ['QuickInfo', 'Editor'].indexOf(args.type) > -1) {
args.cancel = true;
}
}
Q2: How to add custom click event to Angular Schedule events.
Step 1: Bind the eventRendered event to the Schedule like the below.
<ejs-schedule #scheduleObj height='650px' [(selectedDate)]="selectedDate" [eventSettings]="eventSettings"
(popupOpen)='onPopupOpen($event)' (eventRendered)='onEventRendered($event)'>
Step 2: Add the definition for the eventRendered event like the below.
public onEventRendered(args: EventRenderedArgs) {
// Adding the custom click event to the type "A" event
if(args.data.EventType === 'A') {
args.element.addEventListener('click', this.customClick);
}
}
Step 3: Add the custom click event definition like the below and perform your custom action inside of it.
public customClick(args) {
// You can write a code for new functionality to event click here
if(args.detail === 1) {
console.log('Custom click event fires');
}
}
Kindly try the above sample and get back to us If you would require further assistance.
Regards,
Ravikumar Venkatesan