The DayPilot.Scheduler constructor creates a Scheduler instance for a placeholder element and can apply the initial configuration.
new DayPilot.Scheduler(id, options)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().
The options parameter is supported since DayPilot Pro 7.9.
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();Angular [doc.daypilot.org]
React [doc.daypilot.org]
Timeline [doc.daypilot.org]