New to Kendo UI for jQuery? Download free 30-day trial

jQuery SpeechToTextButton MVVM

Loading Demo...
  • EXAMPLE
  • VIEW SOURCE
mvvm.html

Description

The Kendo UI for jQuery MVVM feature seamlessly integrates with the Kendo UI DataSource and UI components and provides powerful two-way data binding capabilities which create attribute values for component observables and modify them automatically when the user interacts with the UI.

The Model-View-ViewModel (MVVM) architecture is a popular design pattern which helps you separate the data (Model) from the UI (View) and expose the Model data objects in a way that they can be easily consumed in the View.

This example shows how to configure the Kendo UI SpeechToTextButton for the MVVM functionality exposed by the framework. First, the demo illustrates how to create a viewmodel instance with the kendo.observable. Then, it instantiates the SpeechToTextButton, its attributes and binding definition by using data- attributes. Note that to wire the viewmodel, you need to invoke the kendo.bind method to the container element of the SpeechToTextButton, and pass the viewmodel as a second argument.

This SpeechToTextButton example is part of a unique collection of hundreds of jQuery demos, with which you can see all Kendo UI for jQuery components and their features in action. View the source code of the demos from the library or directly adapt, and edit them and their theme appearance in Kendo UI for jQuery Dojo or ThemeBuilder.

Description

The MVVM feature of the Kendo UI framework provides powerful two-way data binding capabilities, built on the popular Model-View-ViewModel concept. In this way you can easily make attribute values for components observable and modify them automatically when changes are applied in the data source, or alter the underlying data when the user interacts with the UI.

In this example we show how to configure the Kendo UI treemap to make use of the MVVM functionality exposed by the framework. For this purpose we create a viewmodel instance (with kendo.observable call) which wraps the treemap data source, and instantiate the widget, its attributes and binding definition using data- attributes. The important detail to wire the viewmodel is to invoke kendo.bind to the container element of the treemap, passing the viewmodel as a second argument. Review the code snippets from the demo for more info.

Details on the MVVM features of the Kendo UI framework can be obtained from this chapter of the documentation.

Support & Learning Resources

Additional Resources