React Scheduler Props

An object defining configuration properties for the UI component.

accessKey

Specifies the shortcut key that sets focus on the UI component.

Type:

String

| undefined
Default Value: undefined

The value of this property will be passed to the accesskey attribute of the HTML element that underlies the UI component.

adaptivityEnabled

Specifies whether the UI component adapts to small screens.

Type:

Boolean

Default Value: false

allDayExpr

Specifies the name of the data source item field whose value defines whether or not the corresponding appointment is an all-day appointment.

Type:

String

Default Value: 'allDay'

allDayPanelMode

Specifies the display mode for the All day panel.

Default Value: 'all'

View Demo

allDayPanelMode set to 'all'

To hide the All day panel, set this property to hidden.

If you set the allDayPanelMode property to allDay, the All day panel displays only the appointments whose allDay property is set to true.

To also display appointments that have a duration equal to or more than 24 hours, assign all to this property.

jQuery
index.js
$(function() {
    $("#schedulerContainer").dxScheduler({
        // ...
        allDayPanelMode: 'all',
    });
});
Angular
app.component.html
app.module.ts
<dx-scheduler ... 
    allDayPanelMode="all">
</dx-scheduler>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';

import { DxSchedulerModule } from 'devextreme-angular';

@NgModule({
    declarations: [
        AppComponent
    ],
    imports: [
        BrowserModule,
        DxSchedulerModule
    ],
    providers: [],
    bootstrap: [AppComponent]
})
export class AppModule { }
Vue
App.vue
<template>
    <DxScheduler ...
        all-day-panel-mode="all">
    </DxScheduler>
</template>

<script>
import 'devextreme/dist/css/dx.light.css';

import { DxScheduler } from 'devextreme-vue/scheduler';

export default {
    components: {
        DxScheduler
    },
    data() {
        return {
            // ...
        }
    }
}
</script>
React
App.js
import React from 'react';

import 'devextreme/dist/css/dx.light.css';

import { Scheduler } from 'devextreme-react/scheduler';

class App extends React.Component {
    render() {
        return (
            <Scheduler ...
                allDayPanelMode="all"
            />
        );
    }
}

export default App;

appointmentCollectorComponent

An alias for the appointmentCollectorTemplate property specified in React. Accepts a custom component. Refer to Using a Custom Component for more information.

appointmentCollectorRender

An alias for the appointmentCollectorTemplate property specified in React. Accepts a rendering function. Refer to Using a Rendering Function for more information.

appointmentCollectorTemplate

Specifies a custom template for cell overflow indicators.

Type:

template

Template Data:
Name Type Description
appointmentCount

Number

The count of hidden appointments.

isCompact

Boolean

Indicates whether the overflow indicator is compact.

Default Name: 'appointmentCollector'

jQuery
index.js
$(function() {
    $("#schedulerContainer").dxScheduler({
        // ...
        appointmentCollectorTemplate: function(data, $indicatorElement) {
            $indicatorElement.append(
                // Custom jQuery elements go here
            )
            // ===== or =====
            return /* your markup goes here */
        }
    });
});
Angular
app.component.html
app.module.ts
<dx-scheduler ... 
    appointmentCollectorTemplate="myTemplate">
    <div *dxTemplate="let data of 'myTemplate'">
        <!-- your markup goes here -->
    </div>
</dx-scheduler>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';

import { DxSchedulerModule } from 'devextreme-angular';

@NgModule({
    declarations: [
        AppComponent
    ],
    imports: [
        BrowserModule,
        DxSchedulerModule
    ],
    providers: [],
    bootstrap: [AppComponent]
})
export class AppModule { }
Vue
App.vue
<template>
    <DxScheduler ...
        appointment-collector-template="myTemplate">
        <template #myTemplate="{ data }">
            <!-- your markup goes here -->
        </template>
    </DxScheduler>
</template>

<script>
import 'devextreme/dist/css/dx.light.css';

import { DxScheduler } from 'devextreme-vue/scheduler';

export default {
    components: {
        DxScheduler
    },
    data() {
        return {
            // ...
        }
    }
}
</script>
React
App.js
import React from 'react';

import 'devextreme/dist/css/dx.light.css';

import { Scheduler } from 'devextreme-react/scheduler';

const renderCellOverflowIndicator = (data) => {
    return (
        {/* your markup goes here */}
    );
}

class App extends React.Component {
    render() {
        return (
            <Scheduler ...
                appointmentCollectorRender={renderCellOverflowIndicator}
            />
        );
    }
}

export default App;
See Also

appointmentComponent

An alias for the appointmentTemplate property specified in React. Accepts a custom component. Refer to Using a Custom Component for more information.

appointmentDragging

Configures appointment reordering using drag and drop gestures.

Selector: AppointmentDragging
Type:

Object

appointmentRender

An alias for the appointmentTemplate property specified in React. Accepts a rendering function. Refer to Using a Rendering Function for more information.

appointmentTemplate

Specifies a custom template for appointments.

Type:

template

Template Data:
Name Type Description
appointmentData

dxSchedulerAppointment

The appointment's data object.

targetedAppointmentData

dxSchedulerAppointment

The appointment's data object.
The difference between this and appointmentData fields is explained in the onAppointmentClick description.

Default Name: 'item'

appointmentTooltipComponent

An alias for the appointmentTooltipTemplate property specified in React. Accepts a custom component. Refer to Using a Custom Component for more information.

appointmentTooltipRender

An alias for the appointmentTooltipTemplate property specified in React. Accepts a rendering function. Refer to Using a Rendering Function for more information.

appointmentTooltipTemplate

Specifies a custom template for tooltips displayed when users click an appointment or cell overflow indicator.

Type:

template

Template Data:
Name Type Description
appointmentData

dxSchedulerAppointment

The appointment's data object.

targetedAppointmentData

dxSchedulerAppointment

The clicked appointment's data object.

isButtonClicked

Boolean

Specifies whether you click a button or an appointment element.

Default Name: 'appointmentTooltip'

If you want to change tooltip appearance, implement a custom template with the appointmentTooltipTemplate property. Refer to the Customize Appointment Tooltip section for details.

View Demo

See Also

cellDuration

Specifies cell duration in minutes. This property's value should divide the interval between startDayHour and endDayHour into even parts.

Type:

Number

Default Value: 30

crossScrollingEnabled

Specifies whether or not an end user can scroll the view in both directions at the same time.

Type:

Boolean

Default Value: false

This property is useful when displaying Scheduler on narrow screens.

View Demo

currentDate

Specifies the current date.

Type:

Date

|

Number

|

String

Default Value: new Date()
Raised Events: onOptionChanged

Users can change the current date in the Date Navigator:

Scheduler Date Navigator

To subscribe to changes of the current date, use the onOptionChanged handler.

View Demo

currentView

Specifies the displayed view. Accepts name or type of a view available in the views array.

Type:

ViewType

|

String

Default Value: 'day'
Raised Events: onOptionChanged

View Demo

When more than one view matches the currentView value, the Scheduler displays the first matching view.

To subscribe to changes of the current view, use the onOptionChanged handler.

See Also

customizeDateNavigatorText

Customizes the date navigator's text.

Type:

Function

| undefined
Function parameters:
info:

Object

Information about the date navigator.

Object structure:
Name Type Description
endDate

Date

The view interval's end date.

startDate

Date

The view interval's start date.

text

String

The text displayed in the date navigator.

Return Value:

String

The text that should be displayed.

Default Value: undefined

Scheduler Date Navigator

In the following code, the customizeDateNavigatorText function is used to show dates in the mm/dd/yyyy format (mm/yyyy for the "month" view):

jQuery
JavaScript
$(function() {
    var scheduler;
    $("#schedulerContainer").dxScheduler({
        // ...
        onInitialized: function(e) { scheduler = e.component; },
        customizeDateNavigatorText: function(e) {
            var formatOptions = { 
                year: 'numeric', 
                month: 'numeric', 
                day: 'numeric' 
            };
            var formattedStartDate = e.startDate.toLocaleString("en", formatOptions);
            var formattedEndDate = e.endDate.toLocaleString("en", formatOptions);
            var view = scheduler.option("currentView");
            if(view === "day" | "timelineDay") 
                return formattedStartDate;
            if(view === "month" ) 
                return e.startDate.toLocaleString("en", { year: 'numeric', month: 'numeric' });
            return formattedStartDate + " - " + formattedEndDate;
        }
    });
})
Angular
TypeScript
HTML
import { DxSchedulerModule } from "devextreme-angular";
// ...
export class AppComponent  {
    currentView: string = "day";

    customizeDateNavigatorText = (e) => {
        let formatOptions = { 
            year: 'numeric', 
            month: 'numeric', 
            day: 'numeric' 
        };
        var formattedStartDate = e.startDate.toLocaleString("en", formatOptions);
        var formattedEndDate = e.endDate.toLocaleString("en", formatOptions);
        if(this.currentView === "day" | "timelineDay") 
            return formattedStartDate;
        if(this.currentView === "month" ) 
            return e.startDate.toLocaleString("en", { year: 'numeric', month: 'numeric' });
        return formattedStartDate + " - " + formattedEndDate;
    }
}
@NgModule({
    imports: [
        // ...
        DxSchedulerModule
    ],
    // ...
})
<dx-scheduler ...
    [(currentView)]="currentView"
    [customizeDateNavigatorText]="customizeDateNavigatorText">
</dx-scheduler>
Vue
App.vue
<template>
    <DxScheduler ...
        v-model:current-view="currentView"
        :customize-date-navigator-text="customizeDateNavigatorText">
    </DxScheduler>
</template>

<script>
import 'devextreme/dist/css/dx.light.css';

import { DxScheduler } from 'devextreme-vue/scheduler';

export default {
    components: {
        DxScheduler
    },
    data() {
        return {
            currentView: 'day',
            // ...
        }
    },
    methods: {
        customizeDateNavigatorText(e) {
            const formatOptions = { 
                year: 'numeric', 
                month: 'numeric', 
                day: 'numeric' 
            };
            const formattedStartDate = e.startDate.toLocaleString('en', formatOptions);
            const formattedEndDate = e.endDate.toLocaleString('en', formatOptions);
            if(this.currentView === 'day' | 'timelineDay') 
                return formattedStartDate;
            if(this.currentView === 'month' ) 
                return e.startDate.toLocaleString('en', { year: 'numeric', month: 'numeric' });
            return formattedStartDate + ' - ' + formattedEndDate;
        }
    }
}
</script>
React
App.js
import React, { useCallback, useState } from 'react';

import 'devextreme/dist/css/dx.light.css';

import Scheduler from 'devextreme-react/scheduler';

const App = () => {
    const [currentView, setCurrentView] = useState('day');

    const onOptionChanged = useCallback((e) => {
        if(e.name === 'currentView') {
            setCurrentView(e.value);
        }
    }, [setCurrentView]);

    const customizeDateNavigatorText = useCallback((e) => {
        const formatOptions = { 
            year: 'numeric', 
            month: 'numeric', 
            day: 'numeric' 
        };
        const formattedStartDate = e.startDate.toLocaleString('en', formatOptions);
        const formattedEndDate = e.endDate.toLocaleString('en', formatOptions);
        if(currentView === 'day' | 'timelineDay') 
            return formattedStartDate;
        if(currentView === 'month' ) 
            return e.startDate.toLocaleString('en', { year: 'numeric', month: 'numeric' });
        return formattedStartDate + ' - ' + formattedEndDate;
    }, [currentView]);

    return (
        <Scheduler ...
            currentView={currentView}
            onOptionChanged={onOptionChanged}
            customizeDateNavigatorText={customizeDateNavigatorText}
        />
    );
}

export default App;

dataCellComponent

An alias for the dataCellTemplate property specified in React. Accepts a custom component. Refer to Using a Custom Component for more information.

dataCellRender

An alias for the dataCellTemplate property specified in React. Accepts a rendering function. Refer to Using a Rendering Function for more information.

dataCellTemplate

Specifies a custom template for table cells.

Type:

template

Template Data:

Object

The current table cell's data.

Default Name: null

The following image shows the difference between Scheduler cell types:

DevExtreme Scheduler - Cell Types

Use this template for data cells only.

The data of this template consists of the following fields:

Field name Description
startDate Start date of the data cell.
endDate End date of the data cell.
allDay Specifies whether the appointment in cell lasts all day.
groups A group object to which data cell belongs.
groupIndex Index of a group to which data cell belongs.
text Text of data cell.
NOTE
There is no dataCellTemplate in the agenda view.

View Demo

See Also

dataSource

Binds the UI component to data.

Default Value: null

The Scheduler works with collections of objects.

Depending on your data source, bind Scheduler to data as follows. In each case, also specify the UI component's startDateExpr and endDateExpr properties. Optionally, set other properties with the Expr postfix.

  • Data Array
    Assign the array to the dataSource option. View Demo

  • Read-Only Data in JSON Format
    Set the dataSource property to the URL of a JSON file or service that returns JSON data.

  • OData
    Implement an ODataStore.

  • Web API, PHP, MongoDB
    Use one of the following extensions to enable the server to process data according to the protocol DevExtreme UI components use:

    Then, use the createStore method to configure access to the server on the client as shown below. This method is part of DevExtreme.AspNet.Data.

    jQuery
    JavaScript
    $(function() {
        let serviceUrl = "https://url/to/my/service";
        $("#schedulerContainer").dxScheduler({
            // ...
            dataSource: DevExpress.data.AspNet.createStore({
                key: "ID",
                loadUrl: serviceUrl + "/GetAction",
                insertUrl: serviceUrl + "/InsertAction",
                updateUrl: serviceUrl + "/UpdateAction",
                deleteUrl: serviceUrl + "/DeleteAction"
            })
        })
    });
    Angular
    app.component.ts
    app.component.html
    app.module.ts
    import { Component } from '@angular/core';
    import CustomStore from 'devextreme/data/custom_store';
    import { createStore } from 'devextreme-aspnet-data-nojquery';
    
    @Component({
        selector: 'app-root',
        templateUrl: './app.component.html',
        styleUrls: ['./app.component.css']
    })
    export class AppComponent {
        store: CustomStore;
        constructor() {
            let serviceUrl = "https://url/to/my/service";
            this.store = createStore({
                key: "ID",
                loadUrl: serviceUrl + "/GetAction",
                insertUrl: serviceUrl + "/InsertAction",
                updateUrl: serviceUrl + "/UpdateAction",
                deleteUrl: serviceUrl + "/DeleteAction"
            })
        }
    }
    <dx-scheduler ...
        [dataSource]="store">
    </dx-scheduler>
    import { BrowserModule } from '@angular/platform-browser';
    import { NgModule } from '@angular/core';
    import { AppComponent } from './app.component';
    
    import { DxSchedulerModule } from 'devextreme-angular';
    
    @NgModule({
        declarations: [
            AppComponent
        ],
        imports: [
            BrowserModule,
            DxSchedulerModule
        ],
        providers: [],
        bootstrap: [AppComponent]
    })
    export class AppModule { }
    Vue
    App.vue
    <template> 
        <DxScheduler ...
            :data-source="store" />
    </template>
    
    <script>
    import 'devextreme/dist/css/dx.light.css';
    
    import CustomStore from 'devextreme/data/custom_store';
    import { createStore } from 'devextreme-aspnet-data-nojquery';
    import { DxScheduler } from 'devextreme-vue/scheduler';
    
    export default {
        components: {
            DxScheduler
        },
        data() {
            const serviceUrl = "https://url/to/my/service";
            const store = createStore({
                key: "ID",
                loadUrl: serviceUrl + "/GetAction",
                insertUrl: serviceUrl + "/InsertAction",
                updateUrl: serviceUrl + "/UpdateAction",
                deleteUrl: serviceUrl + "/DeleteAction"
            });
            return {
                store
            }
        }
    }
    </script>
    React
    App.js
    import React from 'react';
    import 'devextreme/dist/css/dx.light.css';
    
    import CustomStore from 'devextreme/data/custom_store';
    import { createStore } from 'devextreme-aspnet-data-nojquery';
    import Scheduler from 'devextreme-react/scheduler';
    
    const serviceUrl = "https://url/to/my/service";
    const store = createStore({
        key: "ID",
        loadUrl: serviceUrl + "/GetAction",
        insertUrl: serviceUrl + "/InsertAction",
        updateUrl: serviceUrl + "/UpdateAction",
        deleteUrl: serviceUrl + "/DeleteAction"
    });
    
    class App extends React.Component {
        render() {
            return (
                <Scheduler ...
                    dataSource={store} />
            );
        }
    }
    export default App;

    View Demo

  • Any other data source
    Implement a CustomStore. View Demo

Regardless of the data source on the input, the Scheduler always wraps it in the DataSource object. This object allows you to sort, filter, group, and perform other data shaping operations. To get its instance, call the getDataSource() method.

NOTE

Review the following notes about data binding:

  • If you wrap the store into the DataSource object explicitly, set the paginate property to false to prevent data from partitioning.

  • Data field names cannot be equal to this and should not contain the following characters: ., :, [, and ].

jQuery
  • The stores are immutable. You cannot change their configurations at runtime. Instead, create a new store or DataSource and assign it to the dataSource property as shown in the following help topic: Get and Set Properties.
Angular
  • The stores are immutable. You cannot change their configurations at runtime. Instead, create a new store or DataSource and assign it to the dataSource property as shown in the following help topic: Two-Way Property Binding.
Vue
  • The stores are immutable. You cannot change their configurations at runtime. Instead, create a new store or DataSource and assign it to the dataSource property as shown in the following help topic: Two-Way Property Binding.
React
  • The stores are immutable. You cannot change their configurations at runtime. Instead, create a new store or DataSource and assign it to the dataSource property as shown in the following help topic: Controlled Mode.

dateCellComponent

An alias for the dateCellTemplate property specified in React. Accepts a custom component. Refer to Using a Custom Component for more information.

dateCellRender

An alias for the dateCellTemplate property specified in React. Accepts a rendering function. Refer to Using a Rendering Function for more information.

dateCellTemplate

Specifies a custom template for day scale items.

Type:

template

Template Data:

Object

The data of the current date scale item.

Default Name: null

The following image shows the difference between Scheduler cell types:

DevExtreme Scheduler - Cell Types

Use this template for date cells only.

The data of this template consists of the following fields:

Field name Description
date Date of the cell.
groups A group object to which date cell belongs.
groupIndex Index of a group to which date cell belongs.
text Text of date cell.

View Demo

NOTE
There is no dateCellTemplate in such views as "day" and "timelineDay".
See Also

dateSerializationFormat

Specifies the format in which date-time values should be sent to the server.

Type:

String

| undefined
Default Value: undefined

Specify this property in the following cases:

  • The dataSource is empty or not set at design time. The dateSerializationFormat is needed, because the Scheduler cannot detect it automatically without a data source.

  • You use the createStore method from the DevExtreme.AspNet.Data extension and remote date-time values are specified in UTC. DevExtreme.AspNet.Data requires the dateSerializationFormat to correctly serialize these values.

Use one of the following values to specify the dateSerializationFormat property:

  • "yyyy-MM-dd" - local date

  • "yyyy-MM-ddTHH:mm:ss" - local date and time

  • "yyyy-MM-ddTHH:mm:ssZ" - UTC date and time

  • "yyyy-MM-ddTHH:mm:ssx", "yyyy-MM-ddTHH:mm:ssxx", "yyyy-MM-ddTHH:mm:ssxxx" - date and time with a timezone

This property applies only if the forceIsoDateParsing field is set to true in the global configuration object.

Web API Service Demo SignalR Service Demo

See Also

descriptionExpr

Specifies the name of the data source item field whose value holds the description of the corresponding appointment.

Type:

String

Default Value: 'description'

disabled

Specifies whether the UI component responds to user interaction.

Type:

Boolean

Default Value: false

dropDownAppointmentComponent Deprecated

An alias for the dropDownAppointmentTemplate property specified in React. Accepts a custom component. Refer to Using a Custom Component for more information.

dropDownAppointmentRender Deprecated

An alias for the dropDownAppointmentTemplate property specified in React. Accepts a rendering function. Refer to Using a Rendering Function for more information.

dropDownAppointmentTemplate Deprecated

Use the appointmentTooltipTemplate property instead.

Specifies a custom template for tooltips displayed when users click a cell overflow indicator.

Type:

template

Template Data:

Object

The appointment's object.

Default Name: 'dropDownAppointment'

editing

Specifies which editing operations a user can perform on appointments.

Selector: Editing
Type:

Boolean

|

Object

Default Value: true

elementAttr

Specifies the global attributes to be attached to the UI component's container element.

Selector: ElementAttr
Type:

Object

Default Value: {}

jQuery
$(function(){
    $("#schedulerContainer").dxScheduler({
        // ...
        elementAttr: {
            id: "elementId",
            class: "class-name"
        }
    });
});
Angular
HTML
TypeScript
<dx-scheduler ...
    [elementAttr]="{ id: 'elementId', class: 'class-name' }">
</dx-scheduler>
import { DxSchedulerModule } from "devextreme-angular";
// ...
export class AppComponent {
    // ...
}
@NgModule({
    imports: [
        // ...
        DxSchedulerModule
    ],
    // ...
})
Vue
App.vue
<template>
    <DxScheduler ...
        :element-attr="schedulerAttributes">
    </DxScheduler>
</template>

<script>
import DxScheduler from 'devextreme-vue/scheduler';

export default {
    components: {
        DxScheduler
    },
    data() {
        return {
            schedulerAttributes: {
                id: 'elementId',
                class: 'class-name'
            }
        }
    }
}
</script>
React
App.js
import React from 'react';

import Scheduler from 'devextreme-react/scheduler';

class App extends React.Component {
    schedulerAttributes = {
        id: 'elementId',
        class: 'class-name'
    }

    render() {
        return (
            <Scheduler ...
                elementAttr={this.schedulerAttributes}>
            </Scheduler>
        );
    }
}
export default App;

endDateExpr

Specifies the name of the data source item field that defines the ending of an appointment.

Type:

String

Default Value: 'endDate'

endDateTimeZoneExpr

Specifies the name of the data source item field that defines the timezone of the appointment end date.

Type:

String

Default Value: 'endDateTimeZone'

endDayHour

Specifies the last hour on the time scale. Accepts integer values from 0 to 24.

Type:

Number

Default Value: 24

This property applies to all views at once. To override it for a specific view, set the same property in the view's configuration object.

View Demo

firstDayOfWeek

Specifies the first day of a week. Does not apply to the agenda view.

Type:

FirstDayOfWeek

| undefined
Default Value: undefined

This property can accept a value from 0 to 6:

  • 0 - Sunday
  • 1 - Monday
  • 2 - Tuesday
  • 3 - Wednesday
  • 4 - Thursday
  • 5 - Friday
  • 6 - Saturday

The value provided by the culture settings is used by default.

View Demo

focusStateEnabled

Specifies whether the UI component can be focused using keyboard navigation.

Type:

Boolean

Default Value: true (desktop)

groupByDate

If true, appointments are grouped by date first and then by resource; opposite if false. Applies only if appointments are grouped and groupOrientation is "horizontal".

Type:

Boolean

Default Value: false

groups

Specifies the resource kinds by which the scheduler's appointments are grouped in a timetable.

Type:

Array<String>

Default Value: []

This array should contain one or more values that correspond to the fieldExpr values of resource kinds:

jQuery
JavaScript
var resources = [
    { fieldExpr: "room", dataSource: roomsDataSource },
    { fieldExpr: "teacher", dataSource: teachersDataSource }
];
var schedulerOptions = {
    dataSource: appointments,
    resources: resources,
    groups: ["room", "teacher"]
    // ...
}
Angular
HTML
TypeScript
<dx-scheduler
    [dataSource]="appointments"
    [resources]="resources"
    [groups]="['room', 'teacher']">
</dx-scheduler>
import { DxSchedulerModule } from "devextreme-angular";
// ...
export class AppComponent  {
    // ...
    resources = [
        { fieldExpr: "room", dataSource: this.roomsDataSource },
        { fieldExpr: "teacher", dataSource: this.teachersDataSource }
    ];
}
@NgModule({
    imports: [
        // ...
        DxSchedulerModule
    ],
    // ...
})
Vue
App.vue
<template>
    <DxScheduler ...
        :data-source="appointments"
        :groups="groups">
        <DxResource
            :data-source="roomsDataSource"
            field-expr="room"
        />
        <DxResource
            :data-source="teachersDataSource"
            field-expr="teacher"
        />
    </DxScheduler>
</template>

<script>
import 'devextreme/dist/css/dx.light.css';

import { DxScheduler } from 'devextreme-vue/scheduler';

export default {
    components: {
        DxScheduler
    },
    data() {
        return {
            dataSource: [ ... ],
            groups: ['room', 'teacher'],
            roomsDataSource: [ ... ],
            teachersDataSource: [ ... ]
            // ...
        }
    }
}
</script>
React
App.js
import React from 'react';

import 'devextreme/dist/css/dx.light.css';

import Scheduler, { Resource } from 'devextreme-react/scheduler';

const App = () => {
    const appointments = [ ... ];
    const roomsDataSource = [ ... ];
    const teachersDataSource = [ ... ];
    const groups = ['room', 'teacher'];

    return (
        <Scheduler ...
            dataSource={appointments}
            groups={groups}>
            <Resource
                dataSource={roomsDataSource}
                fieldExpr="room"
            />
            <Resource
                dataSource={teachersDataSource}
                fieldExpr="teacher"
            />
        </Scheduler>
    );
}

export default App;

To group appointments in the agenda view or by one type of resource, for instance, to group appointments that use a particular room in an office, assign an array with a single element to the groups property. To group appointments by several resource types, assign an array of elements. Each element represents a resource by which appointments are grouped. Each resource is nested in the resource represented by the previous element in the groups array.

View Demo

height

Specifies the UI component's height.

Type:

Number

|

String

|

Function

| undefined
Return Value:

Number

|

String

The UI component's height.

Default Value: undefined

This property accepts a value of one of the following types:

  • Number
    The height in pixels.

  • String
    A CSS-accepted measurement of height. For example, "55px", "20vh", "80%", "inherit".

  • Function (deprecated since v21.2)
    Refer to the W0017 warning description for information on how you can migrate to viewport units.

hint

Specifies text for a hint that appears when a user pauses on the UI component.

Type:

String

| undefined
Default Value: undefined

indicatorUpdateInterval

Specifies the time interval between when the date-time indicator changes its position, in milliseconds.

Type:

Number

Default Value: 300000

max

The latest date the UI component allows you to select.

Type:

Date

|

Number

|

String

| undefined
Default Value: undefined

maxAppointmentsPerCell

Specifies the limit of full-sized appointments displayed per cell. Applies to all views except "agenda".

Default Value: 'auto'

When you set this property to "auto", appointments shrink to a predefined size that depends on the view type. Appointments that do not fit into the cell are hidden, and the cell displays an overflow indicator. Users can click the indicator to display the hidden appointments in a tooltip. The "unlimited" value shrinks appointments without a limit to fit into a cell.

To specify the maximum number of appointments allowed in a single cell, set the property to Number. Appointments that exceed this number are hidden, and the cell displays an overflow indicator. Users can click the indicator to display the hidden appointments in a tooltip.

View Demo

min

The earliest date the UI component allows you to select.

Type:

Date

|

Number

|

String

| undefined
Default Value: undefined

noDataText

Specifies the text or HTML markup displayed by the UI component if the item collection is empty. Available for the Agenda view only.

Type:

String

Default Value: 'No data to display'

The Scheduler component evaluates the noDataText property's value. This evaluation, however, makes the Scheduler potentially vulnerable to XSS attacks. To guard against these attacks, encode the HTML markup before you assign it to the noDataText property. Refer to the following help topic for more information: Potentially Vulnerable API - noDataText.

offset

Specifies the minute offset within Scheduler indicating the starting point of a day.

Type:

Number

Default Value: 0

This property moves the interval between startDayHour and endDayHour. The offset is a multiple of 5 and can range from -1440 minutes (-24 hours) to 1440 minutes (24 hours). For instance, if the following is true:

  • The offset is set to 240.

  • startDayHour is 0 (default).

  • endDayHour is 24 (default).

Then, the day starts and ends at 04:00 AM instead of 00:00.

You can combine this property with different values of startDayHour, endDayHour, and cellDuration to get the desired result. For example, the following code snippet uses all these properties, and as a result, the day starts at 4:40 AM and ends at 12:00 PM.

jQuery
index.js
$(() => {
    $('#scheduler').dxScheduler({
        // ...
        offset: -20,
        startDayHour: 5,
        endDayHour: 12,
        cellDuration: 40,
    });
});
Angular
app.component.html
<dx-scheduler ...
    [offset]="-20"
    [startDayHour]="5"
    [endDayHour]="12"
    [cellDuration]="40"
>
</dx-scheduler>
Vue
App.vue
<template>
    <DxScheduler ...
        offset="-20"
        start-day-hour="5"
        end-day-hour="12"
        cell-duration="40"
    />
</template>

<script>
// ...
</script>
React
App.js
// ...
export default function App() {
    return (
        <Scheduler ...
            offset="-20"
            startDayHour="5"
            endDayHour="12"
            cellDuration="40"
        />
    )
}
NOTE
This property has no effect on the agenda view.

View Demo

onAppointmentAdded

A function that is executed after an appointment is added to the data source.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
appointmentData

dxSchedulerAppointment

The added appointment's data.

component

Scheduler

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

error

JavaScript Error Object

The standard Error object that defines the occurred error.

Default Value: null

onAppointmentAdding

A function that is executed before an appointment is added to the data source.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
appointmentData

dxSchedulerAppointment

The data of the appointment to be added.

cancel

Boolean

|

Promise<Boolean> (jQuery or native)

Allows you to cancel appointment adding.
If you pass a Promise to this field, appointment adding is continued or canceled once the Promise has been resolved.

component

Scheduler

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

Default Value: null

onAppointmentClick

A function that is executed when an appointment is clicked or tapped.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
appointmentData

dxSchedulerAppointment

The initial appointment.

appointmentElement

HTMLElement | jQuery

The clicked's container. It is an HTML Element or a jQuery Element when you use jQuery.

cancel

Boolean

If true, hides the appointment tooltip.

component

Scheduler

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

event

Event (jQuery or EventObject)

The event that caused the function to execute. It is an EventObject or a jQuery.Event when you use jQuery.

targetedAppointmentData

dxSchedulerAppointment

The clicked appointment.

Default Value: null

In case of recurring appointments or appointments with multiple resources, you may need the data object of the clicked appointment, not the initial appointment. For this purpose, use the targetedAppointmentData field of the function's parameter. Otherwise, use the appointmentData field.

For example, the data source contains the following data object:

JavaScript
var appointments = [{
    startDate: new Date(2016, 6, 18, 8),
    endDate: new Date(2016, 6, 18, 9),
    ownerId: [1, 2],
    recurrenceRule: "FREQ=DAILY"
}];

This object describes a series of appointments that belong to two owners and repeat every day. If a user clicks an appointment from this series (for example, the second appointment that belongs to the second owner), appointmentData and targetedAppointmentData will then contain the following data objects:

JavaScript
onAppointmentClick: function(e) {
    console.log(e.appointmentData);
    /* {
        startDate: new Date(2016, 6, 18, 8), 
        endDate: new Date(2016, 6, 18, 9),
        ownerId: [1, 2],
        recurrenceRule: "FREQ=DAILY"
    } */

    console.log(e.targetedAppointmentData);
    /* {
        startDate: new Date(2016, 6, 19, 8), 
        endDate: new Date(2016, 6, 19, 9),
        ownerId: 2,
        recurrenceRule: "FREQ=DAILY"
    } */
}

Additionally, the targetedAppointmentData field has the displayStartDate and displayEndDate date objects. These objects contain time-zone adjusted dates if you specify the timeZone property. If the latter property is not specified, the date objects mentioned above have the same values as the startDate and endDate objects.

JavaScript
onAppointmentClick: function(e) {
    console.log(e.targetedAppointmentData);
    /* {
        startDate: new Date(2016, 6, 19, 8), 
        endDate: new Date(2016, 6, 19, 9),
        displayStartDate: new Date(2016, 6, 19, 10), 
        displayEndDate: new Date(2016, 6, 19, 11),
        ownerId: 2,
        recurrenceRule: "FREQ=DAILY"
    } */
}

onAppointmentContextMenu

A function that is executed when a user attempts to open the browser's context menu for an appointment. Allows you to replace this context menu with a custom context menu.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
appointmentData

dxSchedulerAppointment

The initial appointment.

appointmentElement

HTMLElement | jQuery

The appointment's container. It is an HTML Element or a jQuery Element when you use jQuery.

component

Scheduler

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

event

Event (jQuery or EventObject)

The event that caused the function to execute. It is an EventObject or a jQuery.Event when you use jQuery.

targetedAppointmentData

dxSchedulerAppointment

The appointment's data object.
The difference between this and appointmentData fields is explained in the onAppointmentClick description.

Default Value: null

onAppointmentDblClick

A function that is executed when an appointment is double-clicked or double-tapped.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
appointmentData

dxSchedulerAppointment

The initial appointment.

appointmentElement

HTMLElement | jQuery

The clicked's container. It is an HTML Element or a jQuery Element when you use jQuery.

cancel

Boolean

If true, does not allow the user to open the appointment details form with double click.

component

Scheduler

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

event

Event (jQuery or EventObject)

The event that caused the function to execute. It is an EventObject or a jQuery.Event when you use jQuery.

targetedAppointmentData

dxSchedulerAppointment

The appointment's data object.
The difference between this and appointmentData fields is explained in the onAppointmentClick description.

Default Value: null

onAppointmentDeleted

A function that is executed after an appointment is deleted from the data source.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
appointmentData

dxSchedulerAppointment

The deleted appointment's data.

component

Scheduler

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

error

JavaScript Error Object

The standard Error object that defines the occurred error.

Default Value: null

onAppointmentDeleting

A function that is executed before an appointment is deleted from the data source.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
appointmentData

dxSchedulerAppointment

The data of the appointment to be deleted.

cancel

Boolean

|

Promise<Boolean> (jQuery or native)

Allows you to prevent the appointment from being deleted.
If you pass a Promise to this field, appointment deleting is continued or canceled once the Promise has been resolved.

component

Scheduler

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

Default Value: null

onAppointmentFormOpening

A function that is executed before an appointment details form appears. Use this function to customize the form.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
appointmentData

dxSchedulerAppointment

The data of the appointment for which a form is opened.

cancel

Boolean

If true, prevents the user from opening the appointment details form.

component

Scheduler

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

form

Form

The form's instance; created only once - when the function is executed for the first time.

popup

Popup

The instance of the popup that contains the form.

Default Value: null

The Scheduler displays the appointment details form inside a popup. The elements inside the form are the Form and Popup UI components. Use the onAppointmentFormOpening function's form and popup fields and the Form and Popup API to access and customize the corresponding UI component.

The form organizes its items into two groups:

Group name Description
mainGroup Contains form fields that define main appointment parameters (for example, subject, and description).
recurrenceGroup Contains form fields that define appointment recurrence parameters.

The table below lists 'mainGroup' editor names:

Editor Caption on a Form Editor Name
Subject 'text'. Corresponds to the SchedulerAppointment.text property.
Start Date 'startDate'. Corresponds to the SchedulerAppointment.startDate property.
End Date 'endDate'. Corresponds to the SchedulerAppointment.endDate property.
All Day 'allDay'. Corresponds to the SchedulerAppointment.allDay property.
Description 'description'. Corresponds to the SchedulerAppointment.description property.

You can add a custom item to any group or create an ungrouped item and display it under the groups. If you use the [fieldName]Expr properties to map custom items to data fields, use these property values to access the items on the appointment form.

DevExtreme Scheduler onAppointmentFormOpening

The code below adds a new form item (phone) to the mainGroup and creates an ungrouped item (location). Check the array of form items to ensure that it does not contain an item with the same data field.

The mainGroup consists of two columns. A custom item's colSpan property value is 2. This means that the custom item spans two columns.

jQuery
index.js
$(function() {
    $("#schedulerContainer").dxScheduler({
        dataSource: [{
            text: "Attend the conference",
            startDate: new Date(2020, 4, 24, 9, 10),
            endDate: new Date(2020, 4, 24, 11, 20),
        }],
        currentDate: new Date(2020, 4, 24),

        onAppointmentFormOpening: function(e) {
            e.popup.option('showTitle', true);
            e.popup.option('title', e.appointmentData.text ? 
                e.appointmentData.text : 
                'Create a new appointment');

            const form = e.form;
            let mainGroupItems = form.itemOption('mainGroup').items; 
            if (!mainGroupItems.find(function(i) { return i.dataField === "phone" })) {
                mainGroupItems.push({
                    colSpan: 2, 
                    label: { text: "Phone Number" },
                    editorType: "dxTextBox",
                    dataField: "phone"
                });
                form.itemOption('mainGroup', 'items', mainGroupItems);
            }

            let formItems = form.option("items"); 
            if (!formItems.find(function(i) { return i.dataField === "location" })) {
                formItems.push({
                    colSpan: 2,
                    label: { text: "Location" },
                    editorType: "dxTextBox",
                    dataField: "location"
                });
                form.option("items", formItems);
            }
        }
    });
});
Angular
app.component.html
app.component.ts
<dx-scheduler
    [dataSource]="schedulerData"
    [currentDate]="currentDate"
    (onAppointmentFormOpening)="onAppointmentFormOpening($event)">
</dx-scheduler>
import { DxSchedulerModule } from "devextreme-angular";
// ...
export class AppComponent {
    schedulerData = [{
        text: "Attend the conference",
        startDate: new Date(2020, 4, 24, 9, 10),
        endDate: new Date(2020, 4, 24, 11, 20),
    }];
    currentDate = new Date(2020, 4, 24);

    onAppointmentFormOpening(e) {
        e.popup.option('showTitle', true);
        e.popup.option('title', e.appointmentData.text ? 
            e.appointmentData.text : 
            'Create a new appointment');

        const form = e.form;
        let mainGroupItems = form.itemOption('mainGroup').items; 
        if (!mainGroupItems.find(function(i) { return i.dataField === "phone" })) {
            mainGroupItems.push({
                colSpan: 2, 
                label: { text: "Phone Number" },
                editorType: "dxTextBox",
                dataField: "phone"
            });
            form.itemOption('mainGroup', 'items', mainGroupItems);
        }

        let formItems = form.option("items"); 
        if (!formItems.find(function(i) { return i.dataField === "location" })) {
            formItems.push({
                colSpan: 2,
                label: { text: "Location" },
                editorType: "dxTextBox",
                dataField: "location"
            });
            form.option("items", formItems);
        }
    }
}
@NgModule({
    imports: [
        // ...
        DxSchedulerModule
    ],
    // ...
})
Vue
App.vue
<template>
    <DxScheduler
        :data-source="schedulerData"
        :current-date="currentDate"
        @appointment-form-opening="onAppointmentFormOpening"
    />
</template>

<script>
import 'devextreme/dist/css/dx.light.css';

import DxScheduler from 'devextreme-vue/scheduler';

export default {
    components: {
        DxScheduler
    },
    data() {
        return {
            schedulerData: [{
                text: "Attend the conference",
                startDate: new Date(2020, 4, 24, 9, 10),
                endDate: new Date(2020, 4, 24, 11, 20),
            }],
            currentDate: new Date(2020, 4, 24)
        }
    },
    methods: {
        onAppointmentFormOpening(e) {
            e.popup.option('showTitle', true);
            e.popup.option('title', e.appointmentData.text ? 
                e.appointmentData.text : 
                'Create a new appointment');

            const form = e.form;
            let mainGroupItems = form.itemOption('mainGroup').items; 
            if (!mainGroupItems.find(function(i) { return i.dataField === "phone" })) {
                mainGroupItems.push({
                    colSpan: 2, 
                    label: { text: "Phone Number" },
                    editorType: "dxTextBox",
                    dataField: "phone"
                });
                form.itemOption('mainGroup', 'items', mainGroupItems);
            }

            let formItems = form.option("items"); 
            if (!formItems.find(function(i) { return i.dataField === "location" })) {
                formItems.push({
                    colSpan: 2,
                    label: { text: "Location" },
                    editorType: "dxTextBox",
                    dataField: "location"
                });
                form.option("items", formItems);
            }
        }
    }
}
</script>
React
App.js
import React from 'react';

import 'devextreme/dist/css/dx.light.css';
import Scheduler from 'devextreme-react/scheduler';

const dataSource = [{
    text: "Attend the conference",
    startDate: new Date(2020, 4, 24, 9, 10),
    endDate: new Date(2020, 4, 24, 11, 20),
}];

class App extends React.Component {
    currentDate = new Date(2020, 4, 24);

    onAppointmentFormOpening(e) {
        e.popup.option('showTitle', true);
        e.popup.option('title', e.appointmentData.text ? 
            e.appointmentData.text : 
            'Create a new appointment');

        const form = e.form;
        let mainGroupItems = form.itemOption('mainGroup').items;
        if (!mainGroupItems.find(function(i) { return i.dataField === "phone" })) {
            mainGroupItems.push({
                colSpan: 2, 
                label: { text: "Phone Number" },
                editorType: "dxTextBox",
                dataField: "phone"
            });
            form.itemOption('mainGroup', 'items', mainGroupItems);
        }

        let formItems = form.option("items"); 
        if (!formItems.find(function(i) { return i.dataField === "location" })) {
            formItems.push({
                colSpan: 2,
                label: { text: "Location" },
                editorType: "dxTextBox",
                dataField: "location"
            });
            form.option("items", formItems);
        }
    }

    render() {
        return (
            <Scheduler 
                dataSource={dataSource}
                defaultCurrentDate={this.currentDate}
                onAppointmentFormOpening={this.onAppointmentFormOpening}
            />
        );
    }
}
export default App;

View Demo View on GitHub

See Also

onAppointmentRendered

A function that is executed when an appointment is rendered.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
appointmentData

dxSchedulerAppointment

The initial appointment's data.

appointmentElement

HTMLElement | jQuery

The appointment's container. It is an HTML Element or a jQuery Element when you use jQuery.

component

Scheduler

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

targetedAppointmentData

dxSchedulerAppointment

The appointment's data object.
The difference between this and appointmentData fields is explained in the onAppointmentClick description.

Default Value: null

onAppointmentTooltipShowing

Occurs before showing an appointment's tooltip.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
appointments

Array<Object>

An array of appointments.

cancel

Boolean

Allows you to prevent a tooltip from showing.

component

Scheduler

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

targetElement

HTMLElement | jQuery

The target element of the tooltip.

Default Value: null

onAppointmentUpdated

A function that is executed after an appointment is updated in the data source.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
appointmentData

dxSchedulerAppointment

The updated appointment's data.

component

Scheduler

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

error

JavaScript Error Object

The standard Error object that defines the occurred error.

Default Value: null

onAppointmentUpdating

A function that is executed before an appointment is updated in the data source.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
cancel

Boolean

|

Promise<Boolean> (jQuery or native)

Allows you to prevent an appointment update.
If you pass a Promise to this field, the appointment updating is continued or canceled once the Promise has been resolved.

component

Scheduler

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

newData

Object

The appointment with new data.

oldData

Object

The data of the appointment to be updated.

Default Value: null

onCellClick

A function that is executed when a view cell is clicked.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
cancel

Boolean

Allows you to cancel execution of the default cell click handler.

cellData

Object

The clicked cell's data.

cellElement

HTMLElement | jQuery

The clicked cell's container. It is an HTML Element or a jQuery Element when you use jQuery.

component

Scheduler

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

event

Event (jQuery or EventObject)

The event that caused the function to execute. It is an EventObject or a jQuery.Event when you use jQuery.

Default Value: null

onCellContextMenu

A function that is executed when a user attempts to open the browser's context menu for a cell. Allows you to replace this context menu with a custom context menu.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
cellData

Object

The data of the cell on which the context menu is invoked.

cellElement

HTMLElement | jQuery

The cell's container. It is an HTML Element or a jQuery Element when you use jQuery.

component

Scheduler

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

event

Event (jQuery or EventObject)

The event that caused the function to execute. It is an EventObject or a jQuery.Event when you use jQuery.

Default Value: null

onContentReady

A function that is executed when the UI component is rendered and each time the component is repainted.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

component

Scheduler

The UI component's instance.

Default Value: null

onDisposing

A function that is executed before the UI component is disposed of.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

component

Scheduler

The UI component's instance.

Default Value: null

onInitialized

A function used in JavaScript frameworks to save the UI component instance.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

component

Scheduler

The UI component's instance.

Default Value: null

Angular
app.component.html
app.component.ts
<dx-scheduler ...
    (onInitialized)="saveInstance($event)">
</dx-scheduler>
import { Component } from "@angular/core";
import Scheduler from "devextreme/ui/data_grid";
// ...
export class AppComponent {
    schedulerInstance: Scheduler;
    saveInstance (e) {
        this.schedulerInstance = e.component;
    }
}
Vue
App.vue (Options API)
App.vue (Composition API)
<template>
    <div>
        <DxScheduler ...
            @initialized="saveInstance">
        </DxScheduler>
    </div>
</template>

<script>
import DxScheduler from 'devextreme-vue/scheduler';

export default {
    components: {
        DxScheduler
    },
    data: function() {
        return {
            schedulerInstance: null
        };
    },
    methods: {
        saveInstance: function(e) {
            this.schedulerInstance = e.component;
        }
    }
};
</script>
<template>
    <div>
        <DxScheduler ...
            @initialized="saveInstance">
        </DxScheduler>
    </div>
</template>

<script setup>
import DxScheduler from 'devextreme-vue/scheduler';

let schedulerInstance = null;

const saveInstance = (e) => {
    schedulerInstance = e.component;
}
</script>
React
App.js
import Scheduler from 'devextreme-react/scheduler';

class App extends React.Component {
    constructor(props) {
        super(props);

        this.saveInstance = this.saveInstance.bind(this);
    }

    saveInstance(e) {
        this.schedulerInstance = e.component;
    }

    render() {
        return (
            <div>
                <Scheduler onInitialized={this.saveInstance} />
            </div>
        );
    }
}
See Also
jQuery
  • Get a UI component Instance in jQuery
Angular
  • Get a UI component Instance in Angular
Vue
  • Get a UI component Instance in Vue
React
  • Get a UI component Instance in React

onOptionChanged

A function that is executed after a UI component property is changed.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
value any

The modified property's new value.

previousValue any

The UI component's previous value.

name

String

The modified property if it belongs to the first level. Otherwise, the first-level property it is nested into.

fullName

String

The path to the modified property that includes all parent properties.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

component

Scheduler

The UI component's instance.

Default Value: null

The following example shows how to subscribe to component property changes:

jQuery
index.js
$(function() {
    $("#schedulerContainer").dxScheduler({
        // ...
        onOptionChanged: function(e) {
            if(e.name === "changedProperty") {
                // handle the property change here
            }
        }
    });
});
Angular
app.component.html
app.component.ts
app.module.ts
<dx-scheduler ...
    (onOptionChanged)="handlePropertyChange($event)"> 
</dx-scheduler>
import { Component } from '@angular/core'; 

@Component({ 
    selector: 'app-root', 
    templateUrl: './app.component.html', 
    styleUrls: ['./app.component.css'] 
}) 

export class AppComponent { 
    // ...
    handlePropertyChange(e) {
        if(e.name === "changedProperty") { 
            // handle the property change here
        }
    }
}
import { BrowserModule } from '@angular/platform-browser'; 
import { NgModule } from '@angular/core'; 
import { AppComponent } from './app.component'; 
import { DxSchedulerModule } from 'devextreme-angular'; 

@NgModule({ 
    declarations: [ 
        AppComponent 
    ], 
    imports: [ 
        BrowserModule, 
        DxSchedulerModule 
    ], 
    providers: [ ], 
    bootstrap: [AppComponent] 
}) 

export class AppModule { }  
Vue
App.vue
<template> 
    <DxScheduler ...
        @option-changed="handlePropertyChange"
    />            
</template> 

<script>  
import 'devextreme/dist/css/dx.light.css'; 
import DxScheduler from 'devextreme-vue/scheduler'; 

export default { 
    components: { 
        DxScheduler
    }, 
    // ...
    methods: { 
        handlePropertyChange: function(e) {
            if(e.name === "changedProperty") {
                // handle the property change here
            }
        }
    } 
} 
</script> 
React
App.js
import React from 'react';  
import 'devextreme/dist/css/dx.light.css'; 

import Scheduler from 'devextreme-react/scheduler'; 

const handlePropertyChange = (e) => {
    if(e.name === "changedProperty") {
        // handle the property change here
    }
}

export default function App() { 
    return ( 
        <Scheduler ...
            onOptionChanged={handlePropertyChange}
        />        
    ); 
} 

recurrenceEditMode

Specifies the edit mode for recurring appointments.

Default Value: 'dialog'

This property accepts the following values:

  • "series"
    Enables a user to edit only entire appointment series.

  • "occurrence"
    Enables a user to edit only individual appointment instances.

  • "dialog"
    Displays a dialog that suggests a user to choose between editing the entire series or only the individual instance.

View Demo

The Scheduler handles changes made to an instance and a series differently. If a user edits a recurring appointment instance, two actions are performed on the data objects:

When a user deletes an instance, the Scheduler adds it to series' exceptions by updating the field specified in recurrenceExceptionExpr. Because this is an update, the onAppointmentUpdating and onAppointmentUpdated event handlers are executed instead of onAppointmentDeleting and onAppointmentDeleted.

If a user edits a whole series, only the series data object is updated. When a whole series is deleted, its object is removed.

recurrenceExceptionExpr

Specifies the name of the data source item field that defines exceptions for the current recurring appointment.

Type:

String

Default Value: 'recurrenceException'

recurrenceRuleExpr

Specifies the name of the data source item field that defines a recurrence rule for generating recurring appointments.

Type:

String

Default Value: 'recurrenceRule'

remoteFiltering

Specifies whether filtering is performed on the server or client side.

Type:

Boolean

Default Value: false

Web API Service Demo SignalR Service Demo

NOTE
If you use the CustomStore as a data source and the remoteFiltering property is set to false, the parameter of the load method does not contain the filter field.

resourceCellComponent

An alias for the resourceCellTemplate property specified in React. Accepts a custom component. Refer to Using a Custom Component for more information.

resourceCellRender

An alias for the resourceCellTemplate property specified in React. Accepts a rendering function. Refer to Using a Rendering Function for more information.

resourceCellTemplate

Specifies a custom template for resource headers.

Type:

template

Template Data:

Object

The current resource header's data.

Default Name: null

resources[]

Specifies an array of resources available in the scheduler.

Selector: Resource
Type:

Array<Object>

Default Value: []

Each element of this array is an object that defines a resource kind - a room, a car or any other resource kind. A resource kind object must have at least the following fields.

  • dataSource
    Specify the available resources of this kind (room1, room2, etc.).

  • fieldExpr
    The name of the appointment object field that specifies a resource of this kind (e.g., "room").

There are more fields that can be specified within a resource kind object. They are listed below. For details on how to define a resource and assign it to scheduler appointments, refer to the Resources article. The Scheduler does not support grouping resources by multiple data fields in the agenda view.

Resources Demo Grouping by Resources Demo

rtlEnabled

Switches the UI component to a right-to-left representation.

Type:

Boolean

Default Value: false

When this property is set to true, the UI component text flows from right to left, and the layout of elements is reversed. To switch the entire application/site to the right-to-left representation, assign true to the rtlEnabled field of the object passed to the DevExpress.config(config) method.

JavaScript
DevExpress.config({
    rtlEnabled: true
});

DataGrid Demo Navigation UI Demo Editors Demo

scrolling

Configures scrolling.

Selector: Scrolling
Type: dxSchedulerScrolling

Scrolling allows a user to browse data outside the current viewport. Information about the available scrolling modes is in the mode property description.

View Demo

See Also

selectedCellData

The data of the currently selected cells.

Type:

Array<any>

Read-only
Default Value: []

This array contains objects with the following structure:

{
    startDate: Date,
    endDate: Date,
    allDay: Boolean, 
    groups: { // present if grouping is enabled
        resourceKind: "resourceValue" // for example, room: "101"
    }     
}

You can implement the onOptionChanged function to track all user actions that change selection. The following code logs the selectedCellData value in the browser console.

JavaScript
const onOptionChanged = ({ name, value }) => {
    if (name === "selectedCellData") {
        console.log(value);
    }
};
See Also

shadeUntilCurrentTime

Specifies whether to apply shading to cover the timetable up to the current time.

Type:

Boolean

Default Value: false

showAllDayPanel

Specifies the "All-day" panel's visibility. Setting this property to false hides the panel along with the all-day appointments.

Type:

Boolean

Default Value: true

showCurrentTimeIndicator

Specifies the current date-time indicator's visibility.

Type:

Boolean

Default Value: true

startDateExpr

Specifies the name of the data source item field that defines the start of an appointment.

Type:

String

Default Value: 'startDate'

startDateTimeZoneExpr

Specifies the name of the data source item field that defines the timezone of the appointment start date.

Type:

String

Default Value: 'startDateTimeZone'

startDayHour

Specifies the first hour on the time scale. Accepts integer values from 0 to 24.

Type:

Number

Default Value: 0

This property applies to all views at once. To override it for a specific view, set the same property in the view's configuration object.

View Demo

tabIndex

Specifies the number of the element when the Tab key is used for navigating.

Type:

Number

Default Value: 0

The value of this property will be passed to the tabindex attribute of the HTML element that underlies the UI component.

textExpr

Specifies the name of the data source item field that holds the subject of an appointment.

Type:

String

Default Value: 'text'

timeCellComponent

An alias for the timeCellTemplate property specified in React. Accepts a custom component. Refer to Using a Custom Component for more information.

timeCellRender

An alias for the timeCellTemplate property specified in React. Accepts a rendering function. Refer to Using a Rendering Function for more information.

timeCellTemplate

Specifies a custom template for time scale items.

Type:

template

Template Data:

Object

The data of the current time scale item.

Default Name: null

The following image shows the difference between Scheduler cell types:

DevExtreme Scheduler - Cell Types

Use this template for time cells only.

Field name Description
date Date of the cell.
groups A group object to which time cell belongs.
groupIndex Index of a group to which time cell belongs.
text Text of time cell.

View Demo

NOTE
There is no timeCellTemplate in such views as "month", "timelineMonth" and "agenda".
See Also

timeZone

Specifies the time zone for the Scheduler's grid. Accepts values from the IANA time zone database.

Type:

String

Default Value: ''

If no time zone is specified, the grid displays appointments in the client's time zone.

You can also specify the startDateTimeZone and endDateTimeZone properties for individual appointments.

View Demo

See Also

useDropDownViewSwitcher

Specifies whether a user can switch views using tabs or a drop-down menu.

Type:

Boolean

Default Value: false, true (Android, iOS, Fluent, Material)

Using a drop-down menu makes the view switcher more compact.

View Demo

views[]

Specifies and configures the views to be available in the view switcher.

Selector: View
Type:

Array<String | Object>

Default Value: ['day', 'week']
Accepted Values: 'day' | 'week' | 'workWeek' | 'month' | 'timelineDay' | 'timelineWeek' | 'timelineWorkWeek' | 'timelineMonth' | 'agenda'

This property accepts an array of strings and objects:

  • String
    A view name. Use a string if the view does not need customization, but should be available in the view switcher.

  • Object
    An individual view's configuration. Set the type property to specify the view to which the configuration should apply. This documentation section describes available properties. The properties set for an individual view have a higher priority than the same properties set on the root level for all views.

    JavaScript
    views: [{
            type: 'workWeek',
            name: 'Vertical Grouping',
            groupOrientation: 'vertical',
            cellDuration: 60,
            intervalCount: 2,
        }, {
            type: 'workWeek',
            name: 'Horizontal Grouping',
            groupOrientation: 'horizontal',
            cellDuration: 30,
            intervalCount: 2,
        },
        'agenda'
    ]

To specify the default view, use the currentView property.

View Demo View on GitHub

visible

Specifies whether the UI component is visible.

Type:

Boolean

Default Value: true

width

Specifies the UI component's width.

Type:

Number

|

String

|

Function

| undefined
Return Value:

Number

|

String

The UI component's width.

Default Value: undefined

This property accepts a value of one of the following types:

  • Number
    The width in pixels.

  • String
    A CSS-accepted measurement of width. For example, "55px", "20vw", "80%", "auto", "inherit".

  • Function (deprecated since v21.2)
    Refer to the W0017 warning description for information on how you can migrate to viewport units.