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.
- 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:
- function App() {
- return (
- <Scheduler ... >
- <View type="day" />
- <View type="workWeek" />
- </Scheduler>
- );
- }
Customize Individual Views Demo Increase View Duration Demo