The onRowCreate event handler fires when new row text is submitted in the JavaScript Gantt Chart, before the default action specified by rowCreateHandling.
Declaration
DayPilot.Gantt.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 or replace the default action configured by rowCreateHandling. The corresponding onRowCreated event fires after that default action completes.
Examples
JavaScript
const gantt = new DayPilot.Gantt("dp", {
onRowCreate: (args) => {
if (!args.text.trim()) {
args.preventDefault();
}
},
// ...
});
gantt.init();Angular
<daypilot-gantt [config]="config"></daypilot-gantt>config: DayPilot.GanttConfig = {
onRowCreate: (args) => {
if (!args.text.trim()) {
args.preventDefault();
}
},
// ...
};React
<DayPilotGantt
onRowCreate={onRowCreate}
{/* ... */}
/>const onRowCreate = (args) => {
if (!args.text.trim()) {
args.preventDefault();
}
};Vue
<DayPilotGantt
@rowCreate="onRowCreate"
<!-- ... -->
/>const onRowCreate = (args) => {
if (!args.text.trim()) {
args.preventDefault();
}
};See Also
DayPilot.Gantt.rowCreateHandling
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot