The onEventEdit event handler fires when inline event editing submits new text in the Scheduler.
Declaration
DayPilot.Scheduler.onEventEdit(args)Parameters
args.async(boolean) - enables async processing; callargs.loaded()to complete the actionargs.control(DayPilot.Scheduler) - control instanceargs.canceled(boolean) - submission status (read-only)args.e(DayPilot.Event) - the edited eventargs.newText(string) - new event textargs.loaded()- completes async processingargs.preventDefault()- cancels the default action
Notes
This event is also fired when unmodified text is submitted and when inline editing is canceled using the Escape key. When the edit is canceled, args.canceled is true.
For asynchronous processing, set args.async to true and call args.loaded() when your custom logic finishes.
api=1: In DayPilot.Scheduler.api legacy mode, the signature is onEventEdit(e, newText).
e(DayPilot.Event) - the event referencenewText(string) - new event text
Examples
JavaScript
const dp = new DayPilot.Scheduler("dp", {
onEventEdit: (args) => {
if (args.canceled) {
return;
}
if (!args.newText.trim()) {
args.preventDefault();
}
},
// ...
});
dp.init();Angular
<daypilot-scheduler [config]="config"></daypilot-scheduler>config: DayPilot.SchedulerConfig = {
onEventEdit: (args) => {
if (args.canceled) {
return;
}
if (!args.newText.trim()) {
args.preventDefault();
}
},
// ...
};React
<DayPilotScheduler
onEventEdit={onEventEdit}
{/* ... */}
/>const onEventEdit = (args) => {
if (args.canceled) {
return;
}
if (!args.newText.trim()) {
args.preventDefault();
}
};Vue
<DayPilotScheduler
@eventEdit="onEventEdit"
<!-- ... -->
/>const onEventEdit = (args) => {
if (args.canceled) {
return;
}
if (!args.newText.trim()) {
args.preventDefault();
}
};See Also
Inline Event Editing [doc.daypilot.org]
DayPilot.Scheduler.onEventEditKeyDown
DayPilot.Scheduler.onEventEdited
DayPilot.Scheduler.eventEditHandling
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot