我发现了一个很好的教程,使用Sencha Touch V1.1 从Scratch创建MVC应用程序,但不幸的是它并不适用于Sencha Touch V2.我想学习构建MVC应用程序的新的/正确的方法,以推进他们的最新框架.
使用Sencha Touch V2构建MVC应用程序的任何好教程?
这是我已经看过的地方列表.
source片段,您必须"查看源代码"并尝试浏览库的压缩/缩小版本.我正在运行Sencha Touch V2 beta,我正在查看最新的文档.
我按照Ext.application说明操作,并尝试正确布置我的MVC应用程序.不幸的是,我无法弄清楚如何使用这种方法实际加载View.
index.js
Ext.application({
name: 'rpc',
defaultUrl: 'home/index',
controllers: ['home'], //note: define controllers here
launch: function () {
console.log('Ext.application ~ launch'),
Ext.create('Ext.TabPanel', {
id: 'rpc-rootPanel',
fullscreen: true,
tabBarPosition: 'bottom',
items: [{
title: 'Home',
iconCls: 'home'
}]
});
Ext.create('Ext.viewport.Viewport', {
id:'rpc-rootPanel',
fullscreen: true,
layout: 'card',
cardSwitchAnimation: 'slide'
});
}
});
Run Code Online (Sandbox Code Playgroud)
homeController.js
Ext.define('rpc.controller.home', {
extend: 'Ext.app.Controller',
views: ['home.index'],
stores: [],
refs: [],
init: function () {
console.log('rpc.controller.home ~ init');
},
index: function () {
console.log('rpc.controller.home …Run Code Online (Sandbox Code Playgroud)