Sencha Touch 2 でコントローラーからビューへの参照を取得したいのですが、この質問の説明に従いました: 自動インスタンス化された Sencha Touch 2 ビューへの参照の取得
それでも、コントローラーの this.control の render および show 関数は呼び出されません。
これは私の app.js です:
Ext.application({
name: 'App',
appFolder: 'src',
controllers: ['Home'],
launch: function () {
Ext.Viewport.setActiveItem({xtype: 'homeView'});
}
});
これは私の見解です:
Ext.define('App.view.HomeView', {
extend: 'Ext.Panel',
alias : 'widget.homeView',
config: {
html : ['<h1>Sencha Touch Web App</h1>']
},
initialize: function() {
this.callParent();
}
});
これは私のコントローラーです:
Ext.define('App.controller.Home', {
extend : 'Ext.app.Controller',
views : ['HomeView'],
init: function() {
this.control({
'homeView' : {
render: function() {
console.log('Render method called!');
},
show: function() {
console.log('Show method called!');
}
}
})
}
});
誰かが私が間違っていることを知っていますか?
どうもありがとう。フランツィスカ