Live Demo
Open example in new windowMain Features
- 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.
Use Case
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 withsencha generate app
in a workspace. The following list contains only the relevant files:
1 2 3 4 5 6 7 8 9 |
app/view/main/Main.js app/view/main/MainModel.js app/view/grid/List.js app/view/grid/ListModel.js app/view/form/Detail.js app/view/form/DetailModel.js app/view/form/DetailController.js |
Latest posts by saki (see all)
- Ext, Angular, React, and Vue - June 27, 2019
- The Site Resurgence - February 11, 2018
- Configuring ViewModel Hierarchy - June 19, 2015