All docs
V21.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 - Call Methods

To call a UI component method, you can apply techniques described in the Call Methods topic for jQuery.

As an alternative, you can save the UI component instance in a view model property once the UI component is initialized...

JavaScript
var viewModel = {
    menuInstance: {},
    menuOptions: {
        // ...
        onInitialized: function (e) {
            viewModel.menuInstance = e.component;    
        }
    }
};

ko.applyBindings(viewModel);

... and call any method of the saved instance afterwards.

JavaScript
viewModel.menuInstance.repaint();
See Also
  • API Reference.WidgetName.Methods, for example, API Reference.Menu.Methods