Controlling the Logon and Viewport actions
We are now ready to define the MainController
that will be used to process the core application actions. These include logging on, logging off, and clicking on the header buttons to display the different management panels in the main content area.
The MainController.js file
The MainController.js
definition is as the following code:
Ext.define('TTT.controller.MainController', { extend: 'Ext.app.Controller', requires: ['Ext.window.MessageBox'], views: ['TTT.view.MainHeader', 'TTT.view.MainCards', 'TTT.view.LogonWindow'], refs: [{ ref: 'mainCards', selector: 'maincards' }, { ref: 'usernameField', selector: 'logonwindow textfield[name=username]' }, { ref: 'passwordField', selector: 'logonwindow textfield[name=password]' }], init: function(application) { this.control({ 'mainheader button': { click: this.doHeaderButtonClick }, ...