The onEventDelete event handler fires in the JavaScript Scheduler when the user clicks the built-in delete icon.
Declaration
DayPilot.Scheduler.onEventDelete(args)Parameters
args.async(boolean) - set totrueto enable asynchronous processing (available since 2023.1.5529)args.e(DayPilot.Event) - item selected for deletionargs.control(DayPilot.Scheduler) - control instanceargs.loaded()- continues event processing whenargs.asyncis set totrue(available since 2023.1.5529)args.preventDefault()- cancels the default action
Notes
In api=1 mode, the legacy signature is onEventDelete(e). When you enable asynchronous processing, set args.async to true and call args.loaded() after the custom delete workflow finishes.
Examples
JavaScript
const onEventDelete = (args) => {
if (!confirm("Do you really want to delete this event?")) {
args.preventDefault();
}
};
const dp = new DayPilot.Scheduler("dp", {
onEventDelete: onEventDelete,
// ...
});
dp.init();Angular
<daypilot-scheduler [config]="config"></daypilot-scheduler>const onEventDelete = (args: DayPilot.SchedulerEventDeleteArgs) => {
if (!confirm("Do you really want to delete this event?")) {
args.preventDefault();
}
};
config: DayPilot.SchedulerConfig = {
onEventDelete: onEventDelete,
// ...
};React
<DayPilotScheduler
onEventDelete={onEventDelete}
{/* ... */}
/>const onEventDelete = (args) => {
if (!confirm("Do you really want to delete this event?")) {
args.preventDefault();
}
};Vue
<DayPilotScheduler
@eventDelete="onEventDelete"
<!-- ... -->
/>const onEventDelete = (args) => {
if (!confirm("Do you really want to delete this event?")) {
args.preventDefault();
}
};See Also
DayPilot.Scheduler.onEventDeleted
DayPilot.Scheduler.eventDeleteHandling
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot