How to get which button was clicked on the close event of appointment editor?
This article explains how to determine which button (Save or Cancel button) was clicked while closing the appointment editor window.
Step 1: Bind the popupClose event to the schedule for find which button is clicked on the schedule editor window.
<ejs-schedule #scheduleObj [eventSettings]='eventSettings' (popupClose)="onPopupClose($event)" ></ejs-schedule>
Step 2: Use the following code inside the popupClose event to find the clicked button on the editor window.
public onPopupClose(args: PopupCloseEventArgs) {
if(args.type === 'Editor') {
if(["Add", "Save", "EditSeries", "EditOccurrence"].indexOf(this.scheduleObj.currentAction) > -1) {
// Handle the code if "save" button is clicked.
} else if(this.scheduleObj.currentAction === null) {
// Handle the code if "cancel" button is clicked.
}
}
}
Please refer to the example from the following GitHub link.
Example – Finding clicked button in Angular schedule editor window