utils

An object that serves as a namespace for utility methods that can be helpful when working with the DevExtreme framework and UI widgets.

Included in: dx.mobile.js, dx.web.js, dx.viz.js, dx.viz-web.js, dx.all.js

cancelAnimationFrame(requestID)

Cancels an animation frame request scheduled with the requestAnimationFrame method.

Module: animation/frame
Export: cancel
Parameters:
requestID:

Number

The identifier returned by requestAnimationFrame method.

This method acts as a normalization of the standard cancelAnimationFrame method of the window object.

JavaScript
window.cancelAnimationFrame ||
window.webkitCancelAnimationFrame ||
window.mozCancelAnimationFrame ||
window.oCancelAnimationFrame ||
window.msCancelAnimationFrame

If the API in the code above is not supported, the DevExpress.utils.cancelAnimationFrame(requestID) method clears a timer set with the requestAnimationFrame method.

initMobileViewport(options)

Sets parameters for the viewport meta tag.

Export: default
Parameters:
options:

Object

An object specifying whether to enable or disable pinch-zooming and panning gestures within a mobile browser's view port.

Object structure:
allowZoom:

Boolean

Specifies whether or not to enable pinch-zooming in a mobile browser's view port.

allowPan:

Boolean

Specifies whether or not to enable panning on the vertical and horizontal axes in a mobile browser's view port.

allowSelection:

Boolean

Specifies whether or not to enable selection in a mobile browser's view port.

NOTE
This method is useful in mobile applications only.

requestAnimationFrame(callback)

Requests that the browser call a specified function to update animation before the next repaint.

Module: animation/frame
Export: request
Parameters:
callback:

function

Specifies the function to call when it's time to update your animation for the next repaint.

Return Value:

Number

The request id that uniquely identifies the entry in the callback list.

This method acts as a normalization of the standard requestAnimationFrame method of the window object:

JavaScript
window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame

If the API in the code above is not supported, the DevExpress.utils.requestAnimationFrame(callback) method calls the function passed as a parameter after an internally set timeout.