jQuery/JS Common - utils - events - Methods
off(element, eventName, selector, handler)
The following example demonstrates how to detach a handler from the dxhold event for all elements with my-element
class:
var dxholdHandler = function() { // Process element hold } ... DevExpress.events.off(document, "dxhold", ".my-element", dxholdHandler);
on(element, eventName, selector, data, handler)
A selector to filter the element's descendants. If the selector is null or omitted, the event is always triggered on reaching the element.
Data to be passed to the handler in event.data when the event is triggered.
The following parameters are passed to the handler function:
element
The HTML element on which the event was triggered.extraParameters
Additional parameters. See UI Events for details.
The method should return a Boolean value: true to continue, or false to stop the event propagation.
The following example demonstrates how to attach a handler to the dxhold event for all elements with my-element
class:
var dxholdHandler = function(element, extraParameters) { // Process element hold return true; } DevExpress.events.on(document, "dxhold", ".my-element", { timeout: 1000 }, dxholdHandler);
one(element, eventName, selector, data, handler)
A selector to filter the element's descendants. If the selector is null or omitted, the event is always triggered on reaching the element.
Data to be passed to the handler in event.data when the event is triggered.
The following parameters are passed to the handler function:
element
The HTML element on which the event was triggered.extraParameters
Additional parameters. See UI Events for details.
The method should return a Boolean value: true to continue, or false to stop the event propagation.
The following example demonstrates how to attach a handler to the dxhold event for all elements with my-element
class using the one method.
var dxholdHandler = function(element, extraParameters) { // Process element hold return true; } DevExpress.events.one(document, "dxhold", ".my-element", { timeout: 1000 }, dxholdHandler);
trigger(element, event, extraParameters)
The following code executes all dxhold event handlers of the element with the "myElement" id:
var element = document.getElementById("myElement"); DevExpress.events.trigger(element, "dxhold", { timeout: 1000 });
If you have technical questions, please create a support ticket in the DevExpress Support Center.