Login view
The login view is a window centered in the screen that contains a number of fields. Their values are bound to a login object on the view model, as shown in the following code:
Ext.define('Postcard.view.login.Login',{ extend: 'Ext.window.Window', xtype: 'login-window', title: 'Login to Postcard', closable: false, autoShow: true, controller: 'login', viewModel: 'login', items: [{ xtype: 'textfield', name: 'e-mail', bind: '{login.e-mail}', fieldLabel: 'E-mail', allowBlank: false }, { xtype: 'textfield', bind: '{login.password}', inputType: 'password', fieldLabel: 'Password', allowBlank: false }, { xtype: 'checkbox', bind: '{login.rememberMe}', fieldLabel: 'Remember Me?' }], buttons: [{ text: 'Login' }] });
Note the controller
and ViewModel
configuration options and the prefix of the bind values that links to the login object...