Sencha Docs ExtJs 4.0 MVC例子
目录结构如下:

代码:index.html
<html>
<head>
<title>Account Manager</title>
<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css">
<script type="text/javascript" src="../../bootstrap.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body>
</body>
</html>
app.js
Ext.onReady(function(){
Ext.QuickTips.init();
//Uncaught Ext.Error: Ext.Loader is not enabled...
Ext.Loader.setConfig({
enabled:true
});
Ext.application({
name: 'AM',
appFolder: 'app',
launch: function() {
Ext.create('Ext.container.Viewport', {
layout: 'fit',
items: [
{
xtype: 'panel',
title: 'Users',
html : 'List of users will go here'
}
]
});
},
controllers:[
'UsersControl' //请注意此处
]
});
});
UsersControl.js
Ext.define('AM.controller.UsersControl',{
extend: 'Ext.app.Controller',
init:function(){
console.log('Initialized Users!');
}
});
待续..
本文介绍了一个使用Sencha ExtJS 4.0框架实现的MVC架构应用示例。该示例包括了基本的目录结构、index.html文件、app.js文件以及UsersControl.js文件的内容。通过这个简单的应用程序,读者可以了解到如何利用ExtJS 4.0创建MVC架构的应用。
262

被折叠的 条评论
为什么被折叠?



