The onEventEditKeyDown event handler fires when a keydown event is detected during inline event editing.
Available since version 2021.3.5073.
DayPilot.Scheduler.onEventEditKeyDown(args)args.e (DayPilot.Event) - the active event
args.cancel() - cancels the editing without applying changes, equal to hitting <escape>
args.element - the <textarea> element used for editing
args.originalEvent - the original KeyboardEvent object
args.preventDefault() - cancels the default action defined for <escape> and <enter>
args.submit() - submits the changes, equal to hitting <enter>
Use args.preventDefault() if you need to suppress the built-in handling of <escape> or <enter> and decide explicitly whether to call args.cancel() or args.submit().
JavaScript
const dp = new DayPilot.Scheduler("dp", {
onEventEditKeyDown: (args) => {
if (args.originalEvent.key === "Enter" && !args.element.value.trim()) {
args.preventDefault();
}
},
// ...
});
dp.init();Angular
<daypilot-scheduler [config]="config"></daypilot-scheduler>config: DayPilot.SchedulerConfig = {
onEventEditKeyDown: (args) => {
if (args.originalEvent.key === "Enter" && !args.element.value.trim()) {
args.preventDefault();
}
},
// ...
};React
<DayPilotScheduler
onEventEditKeyDown={onEventEditKeyDown}
{/* ... */}
/>const onEventEditKeyDown = (args) => {
if (args.originalEvent.key === "Enter" && !args.element.value.trim()) {
args.preventDefault();
}
};Vue
<DayPilotScheduler
@eventEditKeyDown="onEventEditKeyDown"
<!-- ... -->
/>const onEventEditKeyDown = (args) => {
if (args.originalEvent.key === "Enter" && !args.element.value.trim()) {
args.preventDefault();
}
};Inline Event Editing [doc.daypilot.org]
DayPilot.Scheduler.onEventEdit