React Scheduler - Customize Individual Views

To customize an individual view, specify a <View> configuration component. 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.

App.tsx
  • import { Scheduler, Resource, View } from 'devextreme-react/scheduler';
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • function renderTimeCell(data: {text: string}): JSX.Element {
  • return (
  • <i style="color: green">{data.text}</i>
  • );
  • }
  •  
  • function App() {
  • return (
  • <Scheduler ... >
  • <Resource
  • fieldExpr="ownerId"
  • dataSource={employees}
  • />
  • <View type="day"
  • cellDuration={60}
  • timeCellRender={renderTimeCell}
  • />
  • <View type="workWeek" groups={['ownerId']} />
  • </Scheduler>
  • );
  • }

To add a view without customizations, specify only the views.type property:

App.tsx
  • function App() {
  • return (
  • <Scheduler ... >
  • <View type="day" />
  • <View type="workWeek" />
  • </Scheduler>
  • );
  • }
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