This address: http://blog.csdn.net/sushengmiyan/article/details/39078627
Sencha official Api:http://docs.sencha.com/extjs/5.0/apidocs/#!/api/ext.panel.panel-cfg-viewmodel
This article Sushengmiyan
--------------------------------------------------------------------------------------------------------------- ---------------------
Sencha Ext JS 5 version of the concept is not viewmodel, now that EXTJS5 support for the MVVM mode, then her components will correspondingly increase the default support for MVVM. Now look at the strong support for the MVVM pattern of the panel component that we often use.
First look at the definition of the document's ViewModel property for the panel:
Viewmodel:string/object/ext.app.viewmodelthe ViewModel is a data provider for this component and its children. The data contained in the ViewModel are typically used by adding bind configs to the components that want present or edit T His data. When set, the ViewModel are created and links to any inherited ViewModel instance from an ancestor container as the "parent ". The ViewModel hierarchy, once established, only supports creation or destruction of children. The parent of a ViewModel cannot is changed on the fly. If This is a root-level ViewModel, the data model connection was made to this component ' s associated data Session. This was determined by calling Getinheritedsession.defaults to: {$value: null, lazy:true}
Translate the above information into the following:
ViewModel: The property can be set to a string or object or Ext.app.ViewModel
ViewModel is the data provider for this component and sub-component, and the data contained in ViewModel is typically used to increase the BIND configuration to the component that wants to render or edit the data.
When set up, ViewModel creates and connects to any parent component on the inheritance hierarchy, and once created, the parent component cannot change the child artifacts.
If the root viewmodel,datamodel is associated to the data node, this is determined by getting the inheritance node.
Default: {$value: null, lazy:true}
To put it simply, when you want to get data from another model in Panle, you need to make a viewmodel, which allows you to get data from ViewModel.
[ExtJS5 Study notes] section 16th EXTJS5 using the panel's new ViewModel property binding data