1. #1
    Sencha User steffenbrem's Avatar
    Join Date
    Mar 2012
    Posts
    36
    Vote Rating
    2
    steffenbrem is on a distinguished road

      0  

    Default Add items to navigation view toolbar

    Add items to navigation view toolbar


    Hello,

    I have a navigation view, which has a main panel and a details panel. In the details panel, I want a button in the top right corner (toolbar). I push to the details panel within my controller, called "Dealers".

    How can I add this button? I tried to set the items property in my details panel, but this just adds another toolbar.


    Thanks!

    Steffen Brem

  2. #2
    Sencha User steffenbrem's Avatar
    Join Date
    Mar 2012
    Posts
    36
    Vote Rating
    2
    steffenbrem is on a distinguished road

      0  

    Default


    Crazy bumb

  3. #3
    Sencha User
    Join Date
    Dec 2010
    Posts
    34
    Vote Rating
    0
    lincon6 is an unknown quantity at this point

      0  

    Default


    Just have a look at the navigationview example.
    Set the button config in navigationBar as below
    code snippet does and control the button's visibility
    and events in the controller.


    Code:
    Ext.define('AddressBook.view.Main', {
        extend: 'Ext.navigation.View',
        xtype: 'mainview',
    
    
        requires: [
            'AddressBook.view.Contacts',
            'AddressBook.view.contact.Show',
            'AddressBook.view.contact.Edit'
        ],
    
    
        config: {
            autoDestroy: false,
    
    
            navigationBar: {
                ui: 'sencha',
                items: [
                    {
                        xtype: 'button',
                        id: 'editButton',
                        text: 'Edit',
                        align: 'right',
                        hidden: true,
                        hideAnimation: Ext.os.is.Android ? false : {
                            type: 'fadeOut',
                            duration: 200
                        },
                        showAnimation: Ext.os.is.Android ? false : {
                            type: 'fadeIn',
                            duration: 200
                        }
                    },
                    {
                        xtype: 'button',
                        id: 'saveButton',
                        text: 'Save',
                        ui: 'sencha',
                        align: 'right',
                        hidden: true,
                        hideAnimation: Ext.os.is.Android ? false : {
                            type: 'fadeOut',
                            duration: 200
                        },
                        showAnimation: Ext.os.is.Android ? false : {
                            type: 'fadeIn',
                            duration: 200
                        }
                    }
                ]
            },
    
    
            items: [
                { xtype: 'contacts' }
            ]
        }
    });

  4. #4
    Sencha User steffenbrem's Avatar
    Join Date
    Mar 2012
    Posts
    36
    Vote Rating
    2
    steffenbrem is on a distinguished road

      0  

    Default


    Thanks, this really helped me

  5. #5
    Sencha User
    Join Date
    Nov 2011
    Posts
    72
    Vote Rating
    0
    kalor is on a distinguished road

      0  

    Default


    ...but totally confused me.

    How come "requires" is in there when the docs say it only applies to Ext.Application?

  6. #6
    Sencha User Pulp Fiction's Avatar
    Join Date
    Mar 2013
    Location
    Italy
    Posts
    77
    Vote Rating
    -1
    Pulp Fiction is an unknown quantity at this point

      0  

    Default


    Hi, thanks, this affects me too. But I didn't understand how to manage the show and hide of the button from the controller. I should bring up the button on the navigationBar only when I'm viewing the detail. Thanks again...