DayPilot.Scheduler.update

The update() methods updates the control after changing the properties. Refreshes the scheduler control, 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

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

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

Partial Update

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

  • separators
  • events
  • rowHeaderColumns

Examples

Changing properties directly:

dp.separators = [{color:"red", location: new DayPilot.Date()}];
dp.update();

Changing properties using options parameter:

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

AngularJS Example

Note: The DayPilot.Scheduler object is stored in the $scope under the name specified using id attribute ($scope.dp in this example).

<div ng-app="main" ng-controller="SchedulerCtrl" >
  <daypilot-scheduler id="dp" daypilot-config="config" daypilot-events="events" ></daypilot-scheduler>
  <div>
      <button ng-click="update()">Refresh the Scheduler</button>
  </div>
</div>

<script>
  var app = angular.module('main', ['daypilot']).controller('SchedulerCtrl', function($scope) {
  // ...

      $scope.update = function() {
          $scope.dp.update();
      };

  // ...
  });
</script>