使用Sencha Touch按钮到另一个页面

时间:2013-07-17 15:16:55

标签: button extjs hyperlink touch

我刚刚用Sencha Touch创建了一个小主页。现在我想使用按钮链接到另一个站点/页面。我怎样才能做到这一点?我不想使用标准的标签栏。

Ext.define('RMA-App.view.Main', {
    extend: 'Ext.Container',
    xtype: 'main',
    requires: [
        'Ext.TitleBar'
    ],
    config: {
        items: [
            {
                docked: 'top',
                xtype: 'titlebar',
                title: 'RMA-App'
            },
            {
                xtype: 'button',
                text: 'Event anlegen',
                ui: 'normal',
                iconCls: 'add',
                iconMask: 'true',
                iconAlign: 'top',
                margin: '5 5 5 5'
            },
            {
                xtype: 'button',
                text: 'Events anzeigen',
                ui: 'normal',
                iconCls: 'list',
                iconMask: 'true',
                iconAlign: 'top',
                margin: '5 5 5 5'
            }
        ]
    }
});

1 个答案:

答案 0 :(得分:1)

您可以导航到使用处理程序查看

{
    xtype: 'button',
    text: 'Events anzeigen',
    handler: function() {
         var someRootContainer = Ext.ComponentQuery.query("#someRootContainer");
         someRootContainer.removeAll();
         someRootContainer.add(Ext.create(yourTargetView));
    }
}