4

I want to add Ext.button.Split into panel's header instead of title. It must be something like switcher of a panel's content and title of the same panel together. Is there any option in extjs 4 to do that? Or is there better solution instead of Split button? Unfortunately, switcher in panel header is the key requirement, so it must be placed there.

ddd
  • 137
  • 2
  • 10

2 Answers2

10

Below works for me ExtJs 4.2.2

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

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

                    }
                ]
            }
}
Peter Li
  • 789
  • 6
  • 13
5

Add the header object to your panel with your tools and add items for 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'
        }]
    }
});
Guilherme Lopes
  • 4,688
  • 1
  • 19
  • 42