torhoehn
torhoehn

Reputation: 95

Button to another Page with Sencha Touch

I just created a little Homepage with Sencha Touch. Now I want use the buttons to link to another site/page. How can I do that? I don't want to use the standard Tab bar.

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'
            }
        ]
    }
});

Upvotes: 1

Views: 843

Answers (1)

Christoph
Christoph

Reputation: 1023

You can navigate to view with a handler

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

Upvotes: 1

Related Questions