JavaScript/jQuery Scheduler - Customize Individual Views

To customize an individual view, specify a configuration object in the views[] array. Assign a view type value to the views.type property to define which view is customized. Specify views[] properties to implement your changes.

The following code snippet customizes the "day" and "workWeek" views. This example groups appointments by a resource in the "workWeek" view. For more information about appointment grouping, refer to the following topic: Group Appointments by Resources.

index.js
  • $(function(){
  • $("#schedulerContainer").dxScheduler({
  • views: [{
  • type: "day",
  • cellDuration: 60,
  • timeCellTemplate: function(data, index, element) {
  • element.text(data.text)
  • .css('color', 'green')
  • .css('font-style', 'italic');
  • }
  • }, {
  • type: "workWeek",
  • groups: ["ownerId"]
  • }],
  • resources: [{ fieldExpr: "ownerId", dataSource: resources }]
  • });
  • });

To add a view without customizations, you can specify ViewType values in the views array:

index.js
  • $(function(){
  • $("#schedulerContainer").dxScheduler({
  • views: ["day", "workWeek"],
  • });
  • });
NOTE
Properties defined in the views[] array override their corresponding properties specified in the component configuration. For instance, views.firstDayOfWeek overrides the firstDayOfWeek property.

Customize Individual Views Demo Increase View Duration Demo

See Also