Action

Deprecated
NOTE
From v18.1, the DevExtreme hybrid mobile-related tools, including DevExtreme SPA Framework, are deprecated. See this blog post for more information.

Custom Knockout binding that links an HTML element with a specific action.

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

Function

|

String

|

Object

Function parameters:
e:

Object

Information about the event.

Object structure:
element:

jQuery

The DOM element involved in this binding.

model:

Object

The model data. Available only if Knockout is used.

jQueryEvent:

jQuery.Event

The jQuery event that caused the handler execution. Deprecated in favor of the event field.

event:

Event (jQuery or dxEvent)

The event that caused the handler execution. It is a dxEvent or a jQuery.Event when you use jQuery.

Use dxAction binding to execute a custom action when clicking a bound HTML element. The action can be defined in one of the following ways.

  • Function
    This function is performed when clicking a bound HTML element.

  • String
    The target URL to be navigated to.

  • Object
    The fields of this object represent parameters for the URL to be navigated to.

Generally, the dxAction binding is analogous to the dxclick event supplied with the DexExtreme UI Events library. However, there two distinctions.

  • The dxAction binding allows you to navigate to a URL by assigning that URL (a string or an object) as a binding value. For details, refer to the Navigate to a View topic.

  • When you assign a function to dxAction binding, you can use the function's parameters to access the DOM element involved in this binding, the model that is available for binding against the element and the jQueryEvent that caused the action execution.