Methods

This section describes methods used to manipulate the widget.

addAppointment(appointment)

Add the appointment defined by the object passed as a parameter to the data associated with the widget.

Parameters:
appointment: Object
An appointment object to be added.

The structure of the added appointment should the same as it is used in the widget's dataSource array or as it comes from the source connected to the widget by the DataSource object.

Consider handling the appointmentAdding and appointmentAdded events to perform custom actions before and after adding an appointment to the widget's data source.

See Also

beginUpdate()

Prevents the widget from refreshing until the endUpdate() method is called.

The beginUpdate() and endUpdate() methods prevent the widget from excessive updates when you are changing multiple widget settings at once. After the beginUpdate() method is called, the widget does not update its UI until the endUpdate() method is called.

See Also

defaultOptions(rule)

Specifies the device-dependent default configuration options for this component.

Parameters:
rule: Object
An object specifying default options for the component and the device for which the options must be applied.
Object structure:
device: Object|Array|function
An object representing device parameters, or an array of objects representing device parameters, or a function that provides information on the current device as an input parameter and returning a Boolean value.
options: Object
A configuration object with specified options.

The defaultOptions method is a static method supported by the widget class. The following code demonstrates how to specify default options for all buttons in the application executed on the iOS platform.

JavaScript
DevExpress.ui.dxButton.defaultOptions({ 
    device: { platform: "ios" },
    options: {
        text: "Click me"
    }
});

deleteAppointment(appointment)

Deletes the appointment defined by the parameter from the the data associated with the widget.

Parameters:
appointment: Object
An appointment object to be deleted.

Pass an entire appointment object to this method so that it is deleted from the data source.

Consider handling the appointmentDeleting and appointmentDeleted events to perform custom actions before and after deleting an appointment from the widget's data source.

See Also

element()

Gets the root element of the widget.

Return Value: jQuery
The root element of the widget.
See Also

endUpdate()

Refreshes the widget after a call of the beginUpdate() method.

Main article: beginUpdate()

See Also

focus()

Sets focus on the widget.

See Also

getDataSource()

Gets the DataSource instance.

Return Value: DataSource
See Also

getEndViewDate()

Returns the end date of the current view.

Return Value: Date
The end date of the current view.
See Also

getStartViewDate()

Returns the start date of the current view.

Return Value: Date
The start date of the current view.
See Also

hideAppointmentPopup(saveChanges)

Hides an appointment details popup.

Parameters:
saveChanges: Boolean
A Boolean value specifying whether or not to save changes made in the appointment detail popup.
See Also

hideAppointmentTooltip()

Hides an appointment tooltip.

See Also

instance()

Returns this widget's instance. Use it to access other methods of the widget.

Return Value: Object
This widget's instance.
See Also

off(eventName)

Detaches all event handlers from the specified event.

Parameters:
eventName: String
The name of the event to unsubscribe from.
Return Value: Object
The object for which this method is called.
See Also

off(eventName, eventHandler)

Detaches a particular event handler from the specified event.

Parameters:
eventName: String
The name of the event to unsubscribe from.
eventHandler: function
The handler to be detached from the specified event.
Return Value: Object
The object for which this method is called.
See Also

on(eventName, eventHandler)

Subscribes to a specified event.

Parameters:
eventName: String
The name of the event to be subscribed.
eventHandler: function
An event handler for the specified event.
Return Value: Object
The object for which this method is called.

Use this method to subscribe to one of the events listed in the Events section.

See Also

on(events)

Subscribes to the specified events.

Parameters:
events: Object
An object of the following structure: { "eventName1": handler1, "eventName2": handler2, ...}
Return Value: Object
The object for which this method is called.

Use this method to subscribe to several events with one method call. Available events are listed in the Events section.

See Also

option()

Gets the widget's options.

Return Value: Object
The widget's options.
See Also

option(optionName)

Gets a specific option value.

Parameters:
optionName: String
The option name or the full path to the option.
Return Value: any
This option value.
See Also

option(optionName, optionValue)

Assigns a new value to a specific option.

Parameters:
optionName: String
The option name or the full path to the option.
optionValue: any
A new value for this option.
See Also

option(options)

Sets one or more options.

Parameters:
options: Object
The options along with their new values.
See Also

registerKeyHandler(key, handler)

Registers a handler to be executed when a user presses a specific key.

Parameters:
key: String
The key for which the handler should be registered.
handler: function
A handler.

The key argument accepts one of the following values:

  • "backspace"
  • "tab"
  • "enter"
  • "escape"
  • "pageUp"
  • "pageDown"
  • "end"
  • "home"
  • "leftArrow"
  • "upArrow"
  • "rightArrow"
  • "downArrow"
  • "del"
  • "space"
  • "F"
  • "A"
  • "asterisk"
  • "minus"

A custom handler for a key cancels the default handler for this key.

See Also

repaint()

Repaints the widget. Call it if you made modifications that changed the widget's state to invalid.

See Also

scrollToTime(hours, minutes, date)

Scrolls the scheduler work space to the specified time of the specified day.

Parameters:
hours: Number
An hour component of the target value.
minutes: Number
A minute component of the target value.
date: Date
A date component of the target value.

If the specified date is not included in the current date range, the method scrolls the scheduler work space to the specified time.

See Also

showAppointmentPopup(appointmentData, createNewAppointment, currentAppointmentData)

Displays the Appointment Details popup.

Parameters:
appointmentData: Object
The initial appointment data object.
createNewAppointment: Boolean
A Boolean value specifying whether or not a new appointment is created when editing is finished.
currentAppointmentData: Object
The current appointment data object.

In case of recurring appointments or appointments with multiple resources, you may want to show a popup for the specified appointment, not the initial appointment. For this purpose, use the currentAppointmentData field of the function parameter. Otherwise, use the appointmentData field.

For example, take a look at a recurring appointment that starts on July 18 at 8:00 AM, repeats every day and belongs to two owners. If you call the method for the appointment from the recurring series, for example the second appointment belonging to the second owner, the following information will be in the appointmentData and currentAppointmentData fields.

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

// The current appointment data
var currentAppointmentData = {
    startDate: new Date(2016, 6, 19, 8), 
    endDate: new Date(2016, 6, 19, 9),
    ownerId: 2,
    recurrenceRule: "FREQ=DAILY"
};
See Also

showAppointmentTooltip(appointmentData, target, currentAppointmentData)

Displays the appointment tooltip for the specified target element.

Parameters:
appointmentData: Object
The initial appointment data object.
Specifies the target element the tooltip points to.
currentAppointmentData: Object
The current appointment data object.

In case of recurring appointments or appointments with multiple resources, you may want to show a tooltip for the specified appointment, not the initial one. For this purpose, use the currentAppointmentData of the method parameters. Otherwise, use the appointmentData parameter.

For example, there is a recurring appointment that starts on July 18 at 8:00 AM, repeats every day and belongs to two owners. If you call the method for an appointment from the recurring series, for example the second appointment belonging to the second owner, the following information will be presented in the appointmentData and currentAppointmentData parameters.

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

// The current appointment data
var currentAppointmentData = {
    startDate: new Date(2016, 6, 19, 8), 
    endDate: new Date(2016, 6, 19, 9),
    ownerId: 2,
    recurrenceRule: "FREQ=DAILY"
};
See Also

updateAppointment(target, appointment)

Updates the appointment specified by the first method parameter by the appointment object specified by the second method parameter in the the data associated with the widget.

Parameters:
target: Object
The appointment object to be updated.
appointment: Object
The appointment object containing new values for the specified target appointment.

Consider handling the appointmentUpdating and appointmentUpdated events to perform custom actions before and after updating an appointment in the widget's data source.

See Also