The eventDeleteHandling property (string) enables the built-in event deleting icon and specifies the default delete action.
DayPilot.Calendar.eventDeleteHandling"Disabled" - hides the built-in delete icon and disables built-in delete handling.
"Update" - removes the event on the client side after DayPilot.Calendar.onEventDelete(args) completes and then fires DayPilot.Calendar.onEventDeleted(args).
"CallBack" - delegates the delete action to server-side callback handling (ASP.NET WebForms, ASP.NET MVC, and Java versions only).
"PostBack" - delegates the delete action using PostBack (ASP.NET WebForms only).
"Disabled"Use DayPilot.Calendar.onEventDelete(args) to confirm or cancel deletion before the event is removed, and use DayPilot.Calendar.onEventDeleted(args) to react after the event has been deleted.
As an alternative to the built-in delete icon, you can offer delete commands using DayPilot.Calendar.contextMenu or custom event active areas.
JavaScript
const calendar = new DayPilot.Calendar("dp", {
eventDeleteHandling: "Update",
onEventDelete: args => {
if (!confirm("Delete this event?")) {
args.preventDefault();
}
},
onEventDeleted: args => {
DayPilot.Modal.alert("Event deleted: " + args.e.text());
},
// ...
});
calendar.init();Angular
<daypilot-calendar [config]="config"></daypilot-calendar>config: DayPilot.CalendarConfig = {
eventDeleteHandling: "Update",
// ...
};React
<DayPilotCalendar
eventDeleteHandling="Update"
{/* ... */}
/>Vue
<DayPilotCalendar
eventDeleteHandling="Update"
<!-- ... -->
/>Event Deleting [doc.daypilot.org]
Event Context Menu [doc.daypilot.org]
Event Active Areas [doc.daypilot.org]
DayPilot.Calendar.onEventDelete