DayPilot.Scheduler Constructor

Declaration

DayPilot.Scheduler(id, options);

Parameters

  • id - id of the placeholder <div> element
  • options - object, properties to be set

Note: "options" are supported since DayPilot Po 7.9

You can set the Scheduler properties using options parameter. It accepts all Scheduler properties and events and the following special properties:

  • events - event array, will be loaded to .events.list
  • scrollTo - horizontal scroll position (DayPilot.Date object or string in ISO 8601 format)
  • scrollToPosition 
  • scrollToAnimation

Example

HTML

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

JavaScript

var scheduler = new DayPilot.Scheduler("dps");
scheduler.theme = "scheduler_white";
scheduler.events.list = [
  { id: 1, start: "2015-01-01T00:00:00", end: "2015-01-01T15:00:00", text: "Event 1", resource: "R1" }
];
scheduler.resources = [
  { id: "R1", name: "Resource 1" }
];
scheduler.init();
scheduler.scrollTo("2015-01-01");

Initialization with properties

var scheduler = new DayPilot.Scheduler("dps", { 
  theme: "scheduler_white",
  events: [
    { id: 1, start: "2015-01-01T00:00:00", end: "2015-01-01T15:00:00", text: "Event 1" }
  ],
  resources: [
  { id: "R1", name: "Resource 1" }
  ],
  scrollTo: "2015-01-01"
 });
scheduler.init();

DayPilot for JavaScript, ASP.NET WebForms, ASP.NET MVC, Java