1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    2
    Vote Rating
    0
    simotho is on a distinguished road

      0  

    Question Unanswered: How to get buttons in the titlebar?

    Unanswered: How to get buttons in the titlebar?


    Hi guys,
    I'm new to Sencha.
    I've played around with Sencha Touch 2 a few days, to figured out the documentation etc.

    But there is one thing I can't get to work.

    If I want to get a button in the titlebar, for example a button where I can click to add an item, how can I do that?

    I've this code at the moment:

    Code:
    var view = Ext.create('Ext.NavigationView', {
        fullscreen: true,
    
    
        items: [{
            title: 'First',
            items: [{
                xtype: 'button',
                text: 'Push a new view!',
                handler: function() {
                    //use the push() method to push another view. It works much like
                    //add() or setActiveItem(). it accepts a view instance, or you can give it
                    //a view config.
                    view.push({
                        title: 'Second',
                        html: 'Second view!'
                    });
                }
            }]
        }]
    });

  2. #2
    Sencha User
    Join Date
    Feb 2012
    Posts
    12
    Vote Rating
    1
    Answers
    1
    JohnWileman is on a distinguished road

      1  

    Default


    The Navigation View has a navigation bar config, you can put your items in there.

    Code:
    config:{
            autoDestroy: false,
            navigationBar: {
                items: [
                    {
                        xtype: 'button',
                        text: 'myButton',
                        align: 'left',
                    }
                ]
            },
            items: [
                    { type: 'panel', html: 'my Panel' }
                ]
        }

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    2
    Vote Rating
    0
    simotho is on a distinguished road

      0  

    Default


    Quote Originally Posted by JohnWileman View Post
    The Navigation View has a navigation bar config, you can put your items in there.

    Code:
    config:{
            autoDestroy: false,
            navigationBar: {
                items: [
                    {
                        xtype: 'button',
                        text: 'myButton',
                        align: 'left',
                    }
                ]
            },
            items: [
                    { type: 'panel', html: 'my Panel' }
                ]
        }
    Perfect, that simple! :-)
    Thanks, John!

Thread Participants: 1

Tags for this Thread