DayPilot.Scheduler Constructor

The DayPilot.Scheduler constructor creates a Scheduler instance for a placeholder element and can apply the initial configuration.

Declaration

new DayPilot.Scheduler(id, options)

Parameters

  • id (string or HTMLElement) - id of the placeholder <div> element or the placeholder DOM element

  • options (object) - initial Scheduler properties and event handlers

You can set the Scheduler properties and event handlers using the options parameter. It accepts all DayPilot.Scheduler Properties and DayPilot.Scheduler Events and also several special properties described in DayPilot.Scheduler.update().

Notes

The options parameter is supported since DayPilot Pro 7.9.

Example

HTML

<div id="dps"></div>

JavaScript

const scheduler = new DayPilot.Scheduler("dps");
scheduler.theme = "scheduler_white";
scheduler.events.list = [
  {
    id: 1,
    start: DayPilot.Date.today(),
    end: DayPilot.Date.today().addHours(15),
    text: "Event 1",
    resource: "R1"
  }
];
scheduler.resources = [
  { id: "R1", name: "Resource 1" }
];
scheduler.init();
scheduler.scrollTo(DayPilot.Date.today());

Initialization with properties

const scheduler = new DayPilot.Scheduler("dps", {
  theme: "scheduler_white",
  events: [
    {
      id: 1,
      start: DayPilot.Date.today(),
      end: DayPilot.Date.today().addHours(15),
      text: "Event 1",
      resource: "R1"
    }
  ],
  resources: [
    { id: "R1", name: "Resource 1" }
  ],
  scrollTo: DayPilot.Date.today()
});
scheduler.init();

See Also

DayPilot.Scheduler Properties

DayPilot.Scheduler Events

DayPilot.Scheduler.update()

Angular [doc.daypilot.org]

React [doc.daypilot.org]

Timeline [doc.daypilot.org]

DayPilot.Scheduler Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript