Search code examples
extjsextjs4extjs4.1toolbar

Extjs - Toolbar instead of title (enable option collapsible)


I have an item like so (JSFiddle Demo):

{
    region: 'west',
    title: 'Instead of toolbar',
    collapsible: true,
    width: 250,
    tbar: [{
        xtype: 'button',
        text: 'Button',
        style: {
            background: 'green'
        },
        handler: function() {}
    }]
}

I want my tbar instead of the title like (1->2)

enter image description here

I tried to remove title but it's not working. How to do that thanks :).


Solution

  • Get rid of the header and add the same collapse tool to the toolbar:

    {
        region: 'west',
        collapsible: true,
        header: false,
        width: 250,
        tbar: [
            {
                xtype: 'button',
                text: 'Button',
                style: {
                    background: 'green'
                },
                handler: function (){}
            },
            '->',
            {
                type: 'left',
                xtype: 'tool',
                handler: function(t) {
                    this.up('panel').collapse();
                }
            }
        ]
    }