DayPilot.Scheduler.update

The update() methods updates the JavaScript Scheduler component and applies the configuration properties.

It refreshes the Scheduler UI, including headers, background cells, and events. It is also possible to update the Scheduler configuration using the optional options parameter.

Declaration

DayPilot.Scheduler.update([options])

Parameters

  • options - object with properties and events to be updated (object)

Even if the options parameter is not specified, all changes made directly to the DayPilot.Scheduler object properties will be applied during the update.

Updating Scheduler Configuration using "options" Parameter

It is possible to update Scheduler properties and events using the options parameter.

scheduler.update({ separators: [{color:"red", location: DayPilot.Date.now()}] });

Supported since version 2018.1.3169.

Special Properties

The options object can specify any of the top-level properties. In addition to the standard properties, the following special properties are supported:

  • scrollTo - scrolls to the specified date/time after update (see also scrollTo() method)

  • scrollX - scrolls to the specified x position (in pixels) after update

  • scrollY - scrolls to the specified y position (in pixels) after update

  • scrollToPosition - the target position (as defined in scrollTo() method "position" parameter)

  • scrollToAnimation- the scrolling animation (as defined in scrollTo() method "animated" parameter)

  • events - the value (array of events) will be saved to events.list before update

  • links - the value (array of links) will be saved to links.list before update

  • zoom - index of the zoom level to be set (since 2019.2.3860)

Example (scrollTo)

scheduler.update({scrollTo: "2025-10-01"});

corresponds to 

scheduler.update();
scheduler.scrollTo("2025-10-01");

Example (resources)

scheduler.update({resources: [ {id: 1, name: ..... }, ... ]});

corresponds to 

scheduler.resources = [ {id: 1, name: ..... }, ... ];
scheduler.update();

Optimized Update

An optimized update is performed if the only property in the options object is one of these properties:

  • separators

  • events

  • links (since version 2023.2.5579)

  • rowHeaderColumns

Example (optimized events update)

scheduler.update({events: [ { id: 1, start: ... }, ... ];

This call invokes an optimized update (only the events will be reloaded and rendered).

Example (optimized separators update)

scheduler.update({ separators: [{color:"red", location: DayPilot.Date.now()}] });