The requested page is not available for the requested platform. You are viewing the content for Default platform.

ASPxClientUtils.AttachEventToElement(element, eventName, method) Method

Binds the specified function to a specific element's event, so that the function gets called whenever the event fires on the element.

Declaration

static AttachEventToElement(element: any, eventName: string, method: any): void

Parameters

Name Type Description
element any

An object specifying the required element.

eventName string

A string value that specifies the required event name without the "on" prefix.

method any

An object that specifies the event's handling function.

Remarks

Use the AttachEventToElement method to attach a handler to the specified DOM event. Note that this method can not be used to attach a handler to a DevExpress event. To learn how to handle DevExpress events, see the Client-Side Events topic.

Examples

Note that the event's name does not contain the "on" prefix.

<ClientSideEvents Init="MyOnInit" />
function MyOnInit(s, e) {
     ASPxClientUtils.AttachEventToElement(s.GetMainElement(), "dblclick", function (event) {
          //code here
     });
};
See Also