JavaScript

Link properties:

  • id (optional; link id)
  • from (source task id)
  • to (target task id)
  • type (optional; the default value is "FinishToStart")
  • width (optional; link width in pixels, default value is 1)
  • color (optional; string)
  • style (optional; string, uses CSS border-type syntax)
  • cssClass (optional; string)

If you use custom color the link end (arrow) will be rendered using built-in styles (you won't be able to style it using CSS).

Example:

gantt.links = [
  {
id: "1", from: "23", to: "24", type: "FinishToStart"
  }
];

Load Links from a URL

Use gantt.links.load(url, success, error) to load a JSON array of dependency links and update the chart.

Invalid Loading Responses

In Pro since version 2026.4.7086, collection loading methods reject empty response bodies, malformed JSON and JSON values that are not arrays. Return [] when the collection is empty.

Supply an error callback to handle these failures. Its args.request is the original XMLHttpRequest; args.exception provides a parsing or validation exception when applicable. The success callback is not called and the existing collection is retained.

gantt.links.load("/api/links", null, args => {
  console.error("Loading failed", args.request.status, args.exception);
});

Availability

Availability of this feature in DayPilot editions:

ProductLitePro
DayPilot for JavaScript
DayPilot for ASP.NET WebForms
DayPilot for ASP.NET MVC
DayPilot for Java