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 orHTMLElement) - id of the placeholder<div>element or the placeholder DOM elementoptions(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
Angular [doc.daypilot.org]
React [doc.daypilot.org]
Timeline [doc.daypilot.org]
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot