This example illustrates configuration of hierarchical view models and it is accompanying the blog post Configuring ViewModel Hierarchy. If you haven’t read this post do it now or the example might not make any sense to you.
- form population on customer selection configured as data binding
- grid, form and main container have their own viewmodels
- grid publishes the current selection that it propagated up to the main viewmodel
- grid viewmodel contains grid store definition
- form viewmodel configures formulas for buttons’ enable/disable logic
- main viewmodel holds the current customer record. All form fields are bound to it.
This example finds its use in any (bigger) application that uses MVVM and data binding architecture. It helps to better modularize and encapsulate views and their view models.
Example Files (relative to example root)
The example has been initially generated with
sencha generate app in a workspace. The following list contains only the relevant files: