1
我已經使用了following tutorial for my project。我需要添加一個按鈕,並在用戶點擊該按鈕時。我需要它導航到另一個vire,但它應該被添加到導航堆棧(所以默認情況下它會有一個後退按鈕)。修改代碼以使其成爲基於導航的應用程序
簡而言之,我需要的是modify the code of this tutorial使它成爲一個基於導航的應用程序。
我已經使用了following tutorial for my project。我需要添加一個按鈕,並在用戶點擊該按鈕時。我需要它導航到另一個vire,但它應該被添加到導航堆棧(所以默認情況下它會有一個後退按鈕)。修改代碼以使其成爲基於導航的應用程序
簡而言之,我需要的是modify the code of this tutorial使它成爲一個基於導航的應用程序。
所有你需要的是Ext.navigation.View
從上面的鏈接試試這個簡單的代碼..
var view = Ext.create('Ext.NavigationView', {
fullscreen: true,
items: [{
title: 'First',
items: [{
xtype: 'button',
text: 'Push a new view!',
handler: function() {
//use the push() method to push another view. It works much like
//add() or setActiveItem(). it accepts a view instance, or you can give it
//a view config.
view.push({
title: 'Second',
html: 'Second view!'
});
}
}]
}]
});
是的,我想這和它的作品。但我想從我的Controller類導航到另一個視圖。由於某種原因,「推」在那裏不起作用。 :( –
在這種情況下,你可以給你的'navigationview'一些'id',然後在處理函數中,你可以寫這樣的東西......'Ext.getCmp('navigate-id')。push({。 ..' –
你的意思是在Main.js上指定一個'id',並從控制器類中調用它? –