Action

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

Provides function parameters.

Object structure:
element:

jQuery

The DOM element involved in this binding.

model:

Object

Provides access to the data that is available for binding against the element. Available only in the Knockout approach.

jQueryEvent:

jQuery.Event

Specifies the jQuery event that caused the action execution.

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.