Extjs 4 - how to add elements to the panel header?

I want to add Ext.button.Split

to the title bar instead of the title. It should be something like a toggle for the contents of a panel and the title of the same panel together. Is there any option in extjs 4 for this? Or is there a better solution instead of the Split button? Unfortunately, the switch in the panel header is a key requirement and needs to be placed there.

+3


source to share


2 answers


Below ExtJs 4.2.2 works for me



{
            xtype: 'panel',
            ......

            header: {
                titlePosition: 0,
                items: [ 
                    {
                        xtype: 'splitbutton',

                    }
                ]
            }
}

      

+8


source


Add a title object to the panel using your tools and add elements for the buttons.



Ext.create('Ext.panel.Panel', {
    width: 300,
    height: 200,
    renderTo: Ext.getBody(),
    header: {
        // if you want your button positioned on the right hand side add
        // titlePosition: 0,
        items: [{
            xtype: 'splitbutton',
            text: 'test'
        }]
    }
});

      

+4


source







All Articles