The onRowCreate event handler fires when new row text is submitted in the JavaScript Scheduler, before the default action specified by rowCreateHandling.
Declaration
DayPilot.Scheduler.onRowCreate(args)Parameters
args.text(string) - new text submitted by the userargs.preventDefault()- prevents the default action specified by rowCreateHandling
Notes
Use args.preventDefault() when you need to validate the submitted text or replace the default action configured by rowCreateHandling.
Examples
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();
}
};See Also
Row Creating [doc.daypilot.org]
DayPilot.Scheduler.rowCreateHandling
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot