The eventDeleteHandling property (string) enables the built-in event deleting icon and specifies the default delete action.
Declaration
DayPilot.Calendar.eventDeleteHandlingPossible Values
"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).
Default Value
"Disabled"Notes
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.
Examples
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"
<!-- ... -->
/>See Also
Event Deleting [doc.daypilot.org]
Event Context Menu [doc.daypilot.org]
Event Active Areas [doc.daypilot.org]
DayPilot.Calendar.onEventDelete
DayPilot.Calendar.onEventDeleted
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot