The onLinkCreated event handler fires when the user finishes creating a link using drag and drop, after the default action specified by linkCreateHandling.
Declaration
DayPilot.Gantt.onLinkCreated(args)
Parameters
args.control- DayPilot.Gantt instance that raised the event.args.source- source DayPilot.Task.args.target- target DayPilot.Task.args.type(string) - link type:"StartToStart","StartToFinish","FinishToStart", or"FinishToFinish".
Notes
Use onLinkCreate if you need to validate the new link or cancel the default action before it runs.
Examples
JavaScript
const gantt = new DayPilot.Gantt("dp", {
linkCreateHandling: "Update",
onLinkCreated: (args) => {
DayPilot.Modal.alert("Link created, type: " + args.type);
},
// ...
});
gantt.init();
Angular
<daypilot-gantt [config]="config"></daypilot-gantt>
config: DayPilot.GanttConfig = {
linkCreateHandling: "Update",
onLinkCreated: args => {
DayPilot.Modal.alert("Link created, type: " + args.type);
},
// ...
};
React
<DayPilotGantt
linkCreateHandling="Update"
onLinkCreated={onLinkCreated}
{/* ... */}
/>
const onLinkCreated = (args) => {
DayPilot.Modal.alert("Link created, type: " + args.type);
};
Vue
<DayPilotGantt linkCreateHandling="Update" @linkCreated="onLinkCreated" <!-- ... --> />
const onLinkCreated = (args) => {
DayPilot.Modal.alert("Link created, type: " + args.type);
};
See Also
Link Creation (Drag and Drop) [doc.daypilot.org]
Link Shape [doc.daypilot.org]
DayPilot.Gantt.linkCreateHandling
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot