代码之家  ›  专栏  ›  技术社区  ›  Hunt

在sencha touch中手动返回上一个屏幕

  •  0
  • Hunt  · 技术社区  · 13 年前

    我有一个自定义标题栏,如下所示,其中有3个按钮

    1) which leads to previous screen
    2) back record 
    3) next record 
    

    enter image description here

    这是自定义标题栏的代码

         {
            xtype : 'titlebar',
            title : 'Contacts',
            items : [{
    
                      ui:'back',text:'-', aling: 'left'  , action:'fback'
    
                },{
                    ui: 'back', text: 'back', align : 'left', action: 'back'
                },{
                    ui: 'forward', text: 'next', align : 'right', action: 'next'
                }]
        }
    

    现在,当我在的控制器中捕捉到事件时 fback 我要开枪了 history.back() 返回到上一个屏幕,但它甚至不起作用 tap 事件正在启动。

    我使用这个自定义标题是因为我不知道如何添加 prev 和 next 按钮插入 navigation view

    1 回复  |  直到 13 年前
        1
  •  0
  •   Community Mohan Dere    9 年前

    如果你想使用浏览器的历史记录,你应该实现 Routes .

    看看: http://docs.sencha.com/touch/2.2.1/#!/guide/history_support

    否则,您必须扩展导航视图 adding a next button to the navbar 然后找到恢复“下一个”视图的方法。

    推荐文章