1

我正在按照教程创建一个 Sencha Touch 应用程序,

我想在同一个屏幕上创建 2 个按钮,每个按钮在单击时重定向到另一个页面,在教程中它使用表单面板并且只有一个按钮重定向到另一个页面,但是如果我将 2 个表单面板链接到导航器视图,它只出现一个表单面板,我想知道一种在同一屏幕上添加 2 个按钮并为每个按钮调用一个 userAlias 以重定向到另一个页面的方法。

我做什么 ?在同一个 FormPanel 上添加 2 个按钮?如果是,我如何为每个按钮调用一个不同的页面,因为我在表单面板上仅使用一个 userAlias 和此功能:

button.up('navigationview').push({
     xtype: 'step3',
     title: 'Step 3'
 });

谢谢您的帮助

4

1 回答 1

1

对按钮使用两个不同的处理程序。

示例 :: 按钮 1 ::

{
  xtype : 'button',
  text : 'button 1',
  handler : function(){
    alert('do something');
    this.up('navigationview').push({ . . . . });
  }
}

示例 :: 按钮 2 ::

{
  xtype : 'button',
  text : 'button 2',
  handler : function(){
    alert('do something else');
    this.up('navigationview').push({ . . . . });
  }
}
于 2013-04-29T14:20:06.853 回答