我有一個Home.js視圖,其中一些嵌入的xtype對於底部欄中的子頁面。首先,我在配置中添加了其他視圖,並且一切正常,但現在我需要使用initalize方法設置其他一些內容(即用戶名)。添加初始化函數時Sencha xtype導航失敗
但是,現在到其他視圖的導航不再觸發。沒有任何事情發生,沒有行動被解僱或任何錯誤。該視圖仍然正確顯示。
觀
Ext.define('MyApp.view.Home', {
extend : 'Ext.tab.Panel',
id : 'home',
xtype : 'homeview',
requires : ['Ext.TitleBar', 'Ext.Video', 'MyApp.view.Profile'],
initialize : function() {
console.log('Initializing Home');
var me = this
var config = me.getInitialConfig();
var username = config.username;
var items = [];
items.push({
xtype : 'titlebar',
docked : 'top',
title : 'Hello ' + username
}, {
xtype : 'updatesview',
}, {
xtype : 'searchview',
}, {
xtype : 'profileview'
}, {
xtype : 'messagesview'
}, {
xtype : 'sensesview'
});
me.setItems(items);
console.log('Initializing Home');
},
config : {
title : 'Home',
iconCls : 'home',
tabBarPosition : 'bottom'
}
});
切換回這個作品只使用配置
Ext.define('MyApp.view.Home', {
extend : 'Ext.tab.Panel',
id : 'home',
xtype : 'homeview',
requires : ['Ext.TitleBar', 'Ext.Video', 'MyApp.view.Profile'],
config : {
title : 'Home',
iconCls : 'home',
tabBarPosition : 'bottom',
items : [{
xtype : 'updatesview',
}, {
xtype : 'searchview',
}, {
xtype : 'profileview'
}, {
xtype : 'messagesview'
}, {
xtype : 'sensesview'
}]
}
});
更新
(????)舊觀點,
我都嘗試
me.setItems(items);
me.addItems(items);
無工作。
更新2
確定問題出在初始化函數。 ANY init禁用導航(??)
initialize : function() {
console.log('init home');
},
感謝您的幫助!
,這沒有不同的是,鏈接和按鈕出現在底部欄中,但它們只是'死了'... – 2013-03-01 09:26:42