Michael Irigoyen
Michael Irigoyen

Reputation: 22947

How do I make a static TitleBar in my Sencha Touch application?

I would like to create a titlebar for my Sencha Touch application that persists on every single view within the application. This titlebar would be branded with my companies logo and a menu of static options that need to be accessible every where, any time.

I can create this titlebar on each view, but that seems illogical. However, I cannot determine, either from the documentation nor several Google/StackOverflow searches, how I can create another view (or maybe it's not consider a view) and have it included on every single view. (I'm thinking a behavior similar to creating a single file in PHP and then including it on many other pages.)

Has anyone done this before and would you be able to share a stripped down example? Or, can someone point me in the right direction within the documentation that perhaps I skipped over? I'm fairly new to Sencha and ExtJS, so things that may seem obvious to veterans are probably going right over my head.

Upvotes: 2

Views: 1130

Answers (1)

fuzzyLikeSheep
fuzzyLikeSheep

Reputation: 473

In the main viewport where you put all your views you can add a titlebar, one way you could do it is like so

mainView = Ext.Viewport.add({
            layout: 'card',
            items: [{
                xtype:'home'
            },{
                xtype:'emContact'
            },{
                xtype: 'titlebar',
                docked: 'top',
                title: 'Navigation',
              }]

        });

Upvotes: 2

Related Questions