The update() method updates the JavaScript Scheduler component and applies configuration changes.
It refreshes the Scheduler UI, including headers, background cells, and events. You can also use the optional options parameter to update properties and event handlers as part of the same call.
Declaration
DayPilot.Scheduler.update([options])Parameters
options(object, optional) - object with properties and event handlers to be updated
Notes
Even if the options parameter is not specified, all changes made directly to the DayPilot.Scheduler object properties are applied during the update.
You can update Scheduler properties and events using the options parameter. This is supported since version 2018.1.3169.
The options object can specify any top-level property. In addition to the standard properties, the following special properties are supported:
scrollTo- scrolls to the specified date/time after update (see also the scrollTo() method)scrollX- scrolls to the specified horizontal position in pixels after updatescrollY- scrolls to the specified vertical position in pixels after updatescrollToPosition- target position as defined by the scrollTo() methodpositionparameterscrollToAnimation- scrolling animation as defined by the scrollTo() methodanimatedparameterevents- array of events that will be saved to events.list before the updatelinks- array of links that will be saved to links.list before the updatezoom- index of the zoom level to be set; supported since 2019.2.3860
An optimized update is performed if the only property in the options object is one of the following values:
separatorseventslinks(since version 2023.2.5579)rowHeaderColumns
Example
Update Scheduler configuration using the options parameter:
scheduler.update({ separators: [{ color: "red", location: DayPilot.Date.now() }] });Scroll to a date after the update:
scheduler.update({ scrollTo: "2025-10-01" });This corresponds to:
scheduler.update();
scheduler.scrollTo("2025-10-01");Update the resource list and refresh the Scheduler:
scheduler.update({ resources: [{ id: 1, name: "Resource" }] });This corresponds to:
scheduler.resources = [{ id: 1, name: "Resource" }];
scheduler.update();Optimized events update:
scheduler.update({ events: [{ id: 1, start: "...", end: "...", text: "Event" }] });This call invokes an optimized update (only the events will be reloaded and rendered).
Optimized separators update:
scheduler.update({ separators: [{ color: "red", location: DayPilot.Date.now() }] });See Also
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot