DayPilot.Switcher.events.load

The events.load() method loads event data for the current view from the specified URL.

Declaration

DayPilot.Switcher.events.load(url[, success[, error]])

Parameters

  • url (string) - URL that will be passed to the current view

  • success (function) - success callback passed to the current view's events.load() method

  • error (function) - error callback passed to the current view's events.load() method

Notes

This method calls the events.load() method of the current view. Depending on the selected view, that is DayPilot.Calendar.events.load() or DayPilot.Month.events.load().

See the methods above for a detailed description of the parameters.

Example

const day = new DayPilot.Calendar("dpDay", {
  // ...
});
day.init();

const month = new DayPilot.Month("dpMonth", {
  // ...
});
month.init();

const switcher = new DayPilot.Switcher({
  triggers: [
    { id: "buttonDay", view: day },
    { id: "buttonMonth", view: month },
  ],
});

switcher.events.load("/calendar_events.php");

See Also

DayPilot.Calendar.events.load()

DayPilot.Month.events.load()

DayPilot.Switcher Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript