Methods

This section describes the methods exposed by the DevExpress.devices namespace.

current()

Returns information about the current device.

Return Value: Device
An object containing information about the current device.

The device information provided by this function may differ from the actual device on which the application is running if an emulated device is specified for the application (see DevExpress.devices.current(deviceName)). The actual information about the device is available via the DevExpress.devices.real() function.

Show Example:
jQuery

current(deviceName)

Overrides actual device information to force the application to operate as if it was running on the specified device.

Parameters:
deviceName: String|Device
The required device name or an object specifying platform information.

The string values accepted by the input parameter are: "iPhone", "iPhone5", "iPad", "iPadMini", "androidPhone", "androidTablet", "win8", "win8Phone", "msSurface", "tizen", and "desktop". The method can also take on an object containing more detailed information on the current platform.

Show Example:
jQuery

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.

For details on using methods for handling events, refer to the Handle Events topic.

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.

For details on using methods for handling events, refer to the Handle Events topic.

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.

For details on using methods for handling events, refer to the Handle Events topic.

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 at one method call. Available events are listed in the Events section.

For details on using methods for handling events, refer to the Handle Events topic.

orientation()

Returns the current device orientation.

Return Value: String
The "portrait" or "landscape" value specifying device orientation.

real()

Returns real information about the current device regardless of the value passed to the devices.current(deviceName) method.

Return Value: Device
An object containing information about the current device.

Show Example:
jQuery