The onRowCreate event handler fires when new row text is submitted in the JavaScript Scheduler, before the default action specified by rowCreateHandling.
DayPilot.Scheduler.onRowCreate(args)args.text (string) - new text submitted by the user
args.preventDefault() - prevents the default action specified by rowCreateHandling
Use args.preventDefault() when you need to validate the submitted text or replace the default action configured by rowCreateHandling.
JavaScript
const dp = new DayPilot.Scheduler("dp", {
rowCreateHandling: "Enabled",
onRowCreate: (args) => {
if (!args.text.trim()) {
args.preventDefault();
}
},
// ...
});
dp.init();Angular
<daypilot-scheduler [config]="config"></daypilot-scheduler>config: DayPilot.SchedulerConfig = {
rowCreateHandling: "Enabled",
onRowCreate: (args) => {
if (!args.text.trim()) {
args.preventDefault();
}
},
// ...
};React
<DayPilotScheduler
rowCreateHandling="Enabled"
onRowCreate={onRowCreate}
{/* ... */}
/>const onRowCreate = (args) => {
if (!args.text.trim()) {
args.preventDefault();
}
};Vue
<DayPilotScheduler
rowCreateHandling="Enabled"
@rowCreate="onRowCreate"
<!-- ... -->
/>const onRowCreate = (args) => {
if (!args.text.trim()) {
args.preventDefault();
}
};Row Creating [doc.daypilot.org]