The links.load() method loads link data directly from the specified URL using an HTTP request. As soon as it receives a response, the JavaScript Scheduler component updates the view and displays the links.

Declaration

DayPilot.Scheduler.links.load(url[, success[, error[, options]]])

Parameters

  • url (string) - JSON endpoint URL

  • success (function) - success callback. The args object provides the response data in args.data and lets you cancel the default handling using args.preventDefault().

  • error (function) - error callback. The args object provides the failed request and the thrown exception.

  • options (object) - additional options. Use dontAddStartEnd (boolean) to prevent adding the current viewport start and end dates to the query string.

Notes

Set options.dontAddStartEnd to true if the endpoint should not receive the current viewport start and end dates in the query string.

Invalid Responses

In Pro since version 2026.4.7086, an empty response body, malformed JSON, or valid JSON that is not an array invokes the error callback. Return [] for an empty collection; an empty body or null is not an empty collection.

args.request contains the original XMLHttpRequest, including for empty responses. args.exception contains the parsing or validation exception when applicable. Invalid responses do not call the success callback or replace the existing collection.

Example

dp.links.load("/api/links", (args) => {
  dp.message("Links loaded");
});

See Also

Links API [doc.daypilot.org]

Dependency Links in the Scheduler Component [doc.daypilot.org]

DayPilot.Scheduler Class

Availability

Availability of this API item in DayPilot editions:

ProductLitePro
DayPilot for JavaScript