Mic C
Mic C

Reputation: 561

adjusting position of button added to panel header?

I can add my own button to the built-in tools "Help" etc on the panel header:

tools:[
    {
        type:'help',
        tooltip: 'Get Help',
        handler: function(event, toolEl, panel){
            // show help here
        }
    }],
header: {
    layout: {
        type: 'hbox',
        align: 'right'
    },
    items: [{
        xtype: 'button',
        text: 'test'
    }]
} ...

but button 'test' appears far left before the panel title ... header layout hbox right obviously not the way to do it :-). Button 'test' just a placeholder - I want to eventually add a menu button - so another css tool would not work - is there a simple way of doing this or do I need to use dom element positiong etc? tia.

Upvotes: 2

Views: 6775

Answers (1)

Towler
Towler

Reputation: 1562

If you're using ExtJS 4.2, you can use the titlePosition property to accomplish this. See http://jsfiddle.net/U8MSd/

    tools: [{
        type: 'help',
        tooltip: 'Get Help',
        handler: function (event, toolEl, panel) {
            // show help here
        }
    }],
    header: {
        titlePosition: 0,
        items: [{
            xtype: 'button',
            text: 'test'
        }]
    }

Upvotes: 4

Related Questions