All docs
V19.2
25.2
The page you are viewing does not exist in version 25.2.
25.1
The page you are viewing does not exist in version 25.1.
24.2
The page you are viewing does not exist in version 24.2.
24.1
The page you are viewing does not exist in version 24.1.
23.2
The page you are viewing does not exist in version 23.2.
23.1
The page you are viewing does not exist in version 23.1.
22.2
The page you are viewing does not exist in version 22.2.
22.1
21.2
21.1
20.2
20.1
19.2
19.1
18.2
18.1
17.2
A newer version of this page is available. Switch to the current version.

DevExtreme jQuery/JS - Handle Events

You can subscribe to an event using a configuration option. All event handling options are given names that begin with on.

HTML
JavaScript
<div dx-menu="{
    ...
    onItemClick: itemClickHandler,
    onInitializedHandler: initializedHandler
 }"></div>
function Controller ($scope) {
    $scope.itemClickHandler = function (info) {
        // Handles the "itemClick" event
    };
    $scope.menuInstance = {};
    $scope.initializedHandler = function (info) {
        // Saves the widget instance
        $scope.menuInstance = info.component;   
        // Handles the "initialized" event
    }
}

View Demo

See Also
  • API Reference.WidgetName.Events, for example, API Reference.Menu.Events