A newer version of this page is available. Switch to the current version.

Call Methods

According to Stack Overflow Trends, MVVM frameworks such as Angular, Vue, and React became more popular than Knockout in recent years. DevExtreme will continue to support Knockout but we recommend that you use one of these frameworks in your new projects.

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

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

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


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

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