Address: http://www.showframework.com/2012/07/extjs-mvc-architecture/
In order to give yourself a better impression, followProgramI wrote it once and encountered some problems in the middle. Practice is the truth
Create index.html to reference JS and CSS of extjs4, create app. JS, and introduce app. js
< Link Href = "Extjs-4.1.0/resources/CSS/ext-all.css" REL = "Stylesheet" Type = "Text/CSS" /> < Script SRC = "Extjs-4.1.0/ext-all-debug.js" Type = "Text/JavaScript" > </ Script > < Script SRC = "App. js" Type = "Text/JavaScript" > </ Script >
App. js
Note:: In extjs4.0, ext. the default value of the loader attribute enabled is true, that is, automatic loading. However, the default value of enabled is false in version 4.1. Therefore, you must set it to true to enable automatic loading. This is a small difference between 4.1 and 4.0,
In addition, the official demo is incorrect. what is written in the official demo?Requires: 'ext. Container. viewport',//Here, the requires must be an array. extjs source code does not handle only one requires.
Ext. loader. setconfig ({enabled: true });Ext. Application ({Requires: ['ext. Container. viewport'],Name: 'am', appfolder: 'app', // relative to the folder app controllers: ['users'], // call launch: function () after all the add-ons are loaded () {Ext. create ('ext. container. viewport', {llayout: 'fit ', items: {xtype: 'userlist '}});}});