【发布时间】:2013-02-13 17:16:02
【问题描述】:
我想知道如何覆盖导航视图上的后退按钮。我尝试使用 onBackButtonTap 但它似乎不起作用http://www.senchafiddle.com/#8zaXf
var view = Ext.Viewport.add({
xtype: 'navigationview',
onBackButtonTap: function () {
alert('Back Button Pressed');
},
//we only give it one item by default, which will be the only item in the 'stack' when it loads
items: [
{
//items can have titles
title: 'Navigation View',
padding: 10,
//inside this first item we are going to add a button
items: [
{
xtype: 'button',
text: 'Push another view!',
handler: function() {
//when someone taps this button, it will push another view into stack
view.push({
//this one also has a title
title: 'Second View',
padding: 10,
//once again, this view has one button
items: [
{
xtype: 'button',
text: 'Pop this view!',
handler: function() {
//and when you press this button, it will pop the current view (this) out of the stack
view.pop();
}
}
]
});
【问题讨论】:
-
你小提琴不能在浏览器(Chrome)中运行。引发语法错误。
-
在这行 `padding:10' 之后缺少
,。 -
@phazorRise 你是对的
-
@MCL 链接和代码已更新
标签: javascript mobile extjs sencha-touch sencha-touch-2