Extjs 4 MVC

Source: Internet
Author: User

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 '}});}});

 

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.