Configuration

An object defining configuration options for the widget.

accessKey

Specifies a shortcut key that sets focus on the widget element.

Type: String
Default Value: null

The accessKey option value is passed to the accesskey attribute of the actual HTML element of the widget.

appointmentTemplate

The template to be used for rendering appointments.

Type: String|function|DOM Node|jQuery
Function parameters:
itemData: Object

The appointment object to be rendered.

itemIndex: Number

The index of the appointment to be rendered.

itemElement: jQuery

An HTML element of the appointment to be rendered.

Return Value: String|DOM Node|jQuery

A template name or a template container.

Default Value: "item"
See Also
NOTE
A binding context of an appointment template is the data source object that corresponds to the currently rendered appointment. So, you can bind template elements to the appointment object's fields directly (see the code above). To access another binding context within an appointment template, use Knockout/Angular binding variables.
Show Example:
AngularJS
Knockout
jQuery

currentDate

Specifies a date displayed on the current scheduler view by default.

Type: Object
Default Value: new Date()

This is the date which is displayed when rendering the widget. Although, an end-user can change the current date by using the Date Navigator.

Show Example:
AngularJS
Knockout
jQuery

currentView

Specifies the view used in the scheduler by default.

Type: String
Default Value: "day"
Accepted Values: 'day'|'week'|'workWeek'|'month'

Specify the views to be available in the scheduler's View Selector for end users in the views array. The default view used by the widget when rendering the scheduler is specified by the currentView option.

Show Example:
AngularJS
Knockout
jQuery

dataSource

A data source used to fetch data to be displayed by the widget.

Default Value: null

If you access a data source containing dxScheduler appointments using a CustomStore, the function passed to the load option should support the dxScheduler field in addition to standard field set of the argument object. This field holds an object containing the following fields.

  • startDate
    Specifies the start date of the range of appointments to be loaded.

  • endDate
    Specifies the end date of the range of appointments to be loaded.

  • resources
    Specifies resources used to filter the appointments to be loaded.

JavaScript
var myDataSource = new data.DataSource({
    store: new data.CustomStore({
        load: function(options) {
            var result = $.Deferred();
            $.ajax({
                url: "/data/appointments",
                data: {
                    start: options.dxScheduler.startDate.getTime(),
                    end: options.dxScheduler.endDate.getTime(),
                    ownerid: options.dxScheduler.resources
                }
            }).done(function(response){
                result.resolve(response);
            });
            return result.promise();
        }
    })
});
NOTE
Filtering by date range and resources should also be implemented on the server.

You can assign an array directly to this option as well as use the Data Source object provided by the DevExtreme library.

To display appointments, a default template can be used. This template is based on the data source fields that are listed in the Default Item Template section of the widget's API. Alternatively, you can implement a custom item template.

See Also

View Demo

Show Example:
AngularJS
Knockout
jQuery

disabled

A Boolean value specifying whether or not the widget can respond to user interaction.

Type: Boolean
Default Value: false

Create an observable variable and assign it to this option to specify the availability of the widget at runtime.

editing

Specifies whether the scheduler data can be edited at runtime.

Type: Boolean
Default Value: true

To make the widget read-only, set this option to false.

Show Example:
AngularJS
Knockout
jQuery

endDayHour

Specifies an end hour in the scheduler view's time interval.

Type: Number
Default Value: 24

firstDayOfWeek

Specifies the first day of a week.

Type: Number
Default Value: undefined

This option can take on a value from 0 to 6.

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

By default, the value provided by the culture settings is used.

focusStateEnabled

Specifies whether or not the widget can be focused.

Type: Boolean
Default Value: false

groups

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

Type: Array
Default Value: []

The array elements should be strings specifying the field field of the resource kind objects.

JavaScript
var resources = [
    { field: 'room', dataSource: roomsDataSource },
    { field: 'teacher', dataSource: teachersDataSource }
];
var schedulerOptions = {
    dataSource: appointments,
    resources: resources,
    groups: ['room', 'teacher']
    //...
}

To group appointments by resources of one kind, for instance to group appointments that use particular rooms in an office, assign an array with a single element to the groups option. To group appointments by several resource kinds, assign an array of elements. Each element will represent a resource by which appointments will be grouped. Each resource will be nested to the resource represented by the previous element in the groups array.

View Demo

Show Example:
AngularJS
Knockout
jQuery

height

Specifies the height of the widget.

Type: Number|String|function
Return Value: Number|String

The widget height.

Default Value: undefined

The option can hold a value of the following types.

  • number
    The height of the widget in pixels

  • string
    A CSS measurement of the widget height (e.g., "55px", "80%", "auto" and "inherit")

  • function
    A function returning the widget height (e.g., height:function(){ return baseHeight - 10 + "%"; })

hint

Specifies the text of the hint displayed for the widget.

Type: String
Default Value: undefined

max

The latest date the widget allows you to select.

Type: Date
Default Value: undefined

min

The earliest date the widget allows you to select.

Type: Date
Default Value: undefined

onAppointmentAdded

A handler for the appointmentAdded event.

Type: function
Function parameters:

Provides function parameters.

Object structure:
component: Object

Provides access to the widget instance.

element: jQuery

An HTML element of the widget.

model: Object

Provides access to the data that is available for binding against the element. Available only in the Knockout and AngularJS approaches.

appointment: Object

The appointment object added to the data source.

The standard Error object that defines the occurred error.

Default Value: null

Assign a function to perform a custom action after an appointment has been added to the widget's data source.

onAppointmentAdding

A handler for the AppointmentAdding event.

Type: function
Function parameters:

Information about the event.

Object structure:
component: Object

The widget instance.

element: jQuery

The widget's container.

model: Object

Data that is available for binding against the element. Available only in the Knockout and AngularJS approaches.

appointment: Object

The appointment object to be added to the data source.

A flag allowing you to prevent the appointment from being added. This field accepts a Boolean value or Promise. If you pass Promise to this field, appointment adding is continued or canceled once Promise has been resolved.

Default Value: null

Assign a function to perform a custom action before an appointment is added to the widget's data source.

Show Example:
AngularJS
Knockout
jQuery

onAppointmentDeleted

A handler for the appointmentDeleted event.

Type: function
Function parameters:

Information about the event.

Object structure:
component: Object

The widget instance.

element: jQuery

The widget's container.

model: Object

Data that is available for binding against the element. Available only in the Knockout and AngularJS approaches.

appointment: Object

The appointment object deleted from the data source.

The standard Error object that defines the occurred error.

Default Value: null

Assign a function to perform a custom action after an appointment has been deleted from the widget's data source.

onAppointmentDeleting

A handler for the AppointmentDeleting event.

Type: function
Function parameters:

Information about the event.

Object structure:
component: Object

The widget instance.

element: jQuery

The widget's container.

model: Object

Data that is available for binding against the element. Available only in the Knockout and AngularJS approaches.

appointment: Object

The appointment object to be deleted from the data source.

A flag that allows you to prevent an appointment from being deleted. This field accepts a Boolean value or Promise. If you pass Promise to this field, appointment deleting is continued or canceled once Promise has been resolved.

Default Value: null

Assign a function to perform a custom action before an appointment is deleted from the widget's data source.

Show Example:
AngularJS
Knockout
jQuery

onAppointmentRendered

A handler for the appointmentRendered event.

Type: function
Function parameters:

Provides function parameters.

Object structure:
component: Object

The widget instance.

element: jQuery

The widget's container.

model: Object

Provides access to the data that is available for binding against the element. Available only in the Knockout and AngularJS approaches.

appointment: Object

The data that is bound to the appointment to be rendered.

appointmentElement: jQuery

An HTML element of the appointment.

appointmentIndex: Number

Specifies the index of the rendered appointment.

Default Value: null

Assign a function to perform a custom action after an appointment is rendered.

onAppointmentUpdated

A handler for the appointmentUpdated event.

Type: function
Function parameters:

Provides function parameters.

Object structure:
component: Object

Provides access to the widget instance.

element: jQuery

An HTML element of the widget.

model: Object

Provides access to the data that is available for binding against the element. Available only in the Knockout and AngularJS approaches.

appointment: Object

The appointment object updated in the data source.

The standard Error object that defines the occurred error.

Default Value: null

Assign a function to perform a custom action after an appointment has been updated in the widget's data source.

onAppointmentUpdating

A handler for the AppointmentUpdating event.

Type: function
Function parameters:

Information about the event.

Object structure:
component: Object

The widget instance.

element: jQuery

The widget's container.

model: Object

Data that is available for binding against the element. Available only in the Knockout and AngularJS approaches.

oldData: Object

The appointment object to be updated in the data source.

newData: Object

The appointment object containing new values for the specified appointment.

A flag that allows you to prevent an appointment from being updated. This field accepts a Boolean value or Promise. If you pass Promise to this field, the appointment updating is continued or canceled once Promise has been resolved.

Default Value: null

Assign a function to perform a custom action before an appointment is updated in the widget's data source.

Show Example:
AngularJS
Knockout
jQuery

onDisposing

A handler for the disposing event.

Type: function
Function parameters:

Provides function parameters.

Object structure:
component: Object

Provides access to the widget instance.

element: jQuery

An HTML element of the widget.

model: Object

Provides access to the data that is available for binding against the element. Available only in the Knockout and AngularJS approaches.

Default Value: null

onInitialized

A handler for the initialized event.

Type: function
Function parameters:

Provides function parameters.

Object structure:
component: Object

Provides access to the widget instance.

element: jQuery

An HTML element of the widget.

Default Value: null

Assign a function to perform a custom action when the widget is initialized.

onOptionChanged

A handler for the optionChanged event.

Type: function
Function parameters:

Provides function parameters.

Object structure:
component: Object

Provides access to the widget instance.

name: String

Specifies the name of the option whose value is changed.

fullName: String

Specifies a full name of the option whose value is changed. The full name is formed by concatenating the names of the options that are presented in the hierarchy of the given option. The names are delimited by commas.

value: any

Specifies a new value for the option.

element: jQuery

An HTML element of the widget.

model: Object

Provides access to the data that is available for binding against the element. Available only in the Knockout and AngularJS approaches.

Default Value: null

Assign a function to perform a custom action after an option of the component is changed.

resources[]

Specifies an array of resources available in the scheduler.

Type: Array
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.

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.

rtlEnabled

Specifies whether or not the current component supports a right-to-left representation.

Type: Boolean
Default Value: false

If you need to switch the display of this DevExtreme component to right-to-left, enable a specifically designed configuration option - rtlEnabled. When this option is set to true, the text flows from right to left, and the layout the component's elements is reversed. To switch the entire application/site to a right-to-left representation, use the static DevExpress.rtlEnabled field.

startDayHour

Specifies a start hour in the scheduler view's time interval.

Type: Number
Default Value: 0

tabIndex

Specifies the widget tab index.

Type: Number
Default Value: 0

views

Lists the views to be available within the scheduler's View Selector.

Type: Array
Default Value: ['day', 'week']
Accepted Values: 'day'|'week'|'workWeek'|'month'

Set a default view by using the currentView option.

Show Example:
AngularJS
Knockout
jQuery

visible

A Boolean value specifying whether or not the widget is visible.

Type: Boolean
Default Value: true

width

Specifies the width of the widget.

Type: Number|String|function
Return Value: Number|String

The widget width.

Default Value: undefined

The option can hold a value of the following types.

  • numeric
    The widget width in pixels.
  • string
    A CSS measurement of the widget width (e.g., "55px", "80%", "auto" and "inherit").
  • function
    The function returning the widget width. For example, see the following code.

    JavaScript
    width: function () { 
        return baseWidth - 10 + "%";
    }