The onEventEdit event handler fires when inline event editing is submitted in the JavaScript Calendar component, before the default edit action is performed.
DayPilot.Calendar.onEventEdit(args)
args.e (DayPilot.Event) - the edited event
args.newText (string) - new event text
args.preventDefault() - cancels the default inline edit action
This event handles the submit step of inline event editing.
In api=1 mode, the legacy signature is onEventEdit(e, newText).
JavaScript
const calendar = new DayPilot.Calendar("dp", {
eventEditHandling: "Update",
onEventEdit: args => {
if (!args.newText.trim()) {
args.preventDefault();
}
},
// ...
});
calendar.init();Angular
<daypilot-calendar [config]="config"></daypilot-calendar>
config: DayPilot.CalendarConfig = {
eventEditHandling: "Update",
onEventEdit: args => {
if (!args.newText.trim()) {
args.preventDefault();
}
},
// ...
};React
<DayPilotCalendar
eventEditHandling="Update"
onEventEdit={onEventEdit}
{/* ... */}
/>const onEventEdit = (args) => {
if (!args.newText.trim()) {
args.preventDefault();
}
};Vue
<DayPilotCalendar eventEditHandling="Update" @eventEdit="onEventEdit" <!-- ... --> />
const onEventEdit = (args) => {
if (!args.newText.trim()) {
args.preventDefault();
}
};DayPilot.Calendar.onEventEdited