Angular Scheduler - Customize Individual Views

To customize individual views, assign an array of configuration objects to the views property. Each object contains the type property that defines which view is customized. Refer to the API Reference for a list of properties.

The following code defines three views: the first is not customized, the second has a specific cell duration and a custom template for the time scale, and the third is grouped by resources.

HTML
TypeScript
  • <dx-scheduler
  • [dataSource]="schedulerData"
  • [currentDate]="currentDate"
  • currentView="day">
  • <dxi-resource
  • fieldExpr="ownerId"
  • [dataSource]="employees">
  • </dxi-resource>
  • <dxi-view type="month"></dxi-view>
  • <dxi-view type="day"
  • [cellDuration]="60"
  • timeCellTemplate="timeCellTemplate">
  • </dxi-view>
  • <dxi-view type="workWeek" [groups]="['ownerId']"></dxi-view>
  • <div *dxTemplate="let data of 'timeCellTemplate'">
  • <i style="color: green">{{data.text}}</i>
  • </div>
  • </dx-scheduler>
  • import { DxSchedulerModule } from "devextreme-angular";
  • // ...
  • export class AppComponent {
  • schedulerData = [{
  • text: "Google AdWords Strategy",
  • ownerId: [2],
  • startDate: new Date("2016-01-01T09:00:00.000Z"),
  • endDate: new Date("2016-01-01T10:30:00.000Z")
  • }, {
  • text: "New Brochures",
  • ownerId: [1],
  • startDate: new Date("2016-01-01T11:30:00.000Z"),
  • endDate: new Date("2016-01-01T14:15:00.000Z")
  • },
  • // ...
  • ];
  • currentDate = new Date(2016, 1, 1);
  • employees [
  • { text: "Samantha Bright", id: 1, color: "#cb6bb2" },
  • { text: "John Heart", id: 2, color: "#56ca85" }
  • ];
  • }
  • @NgModule({
  • imports: [
  • // ...
  • DxSchedulerModule
  • ],
  • // ...
  • })

Customize Individual Views Demo Increase View Duration Demo

See Also