Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I right-align the contents of a ExtJS tbar?

I have a tbar inside a grid panel like this:

enter image description here

This is the code that produces it:

var grid = new Ext.grid.GridPanel({
    region: 'center',
    style: 'margin: 10px',
    store: new Ext.data.Store({
        data: myData,
        reader: myReader
    }),
    title: 'Testing',
    tbar: ['Filters:', {
            width:          100,
            xtype:          'combo',
            mode:           'local',
            value:          'en',
            triggerAction:  'all',
            forceSelection: true,
            editable:       false,
            fieldLabel:     'Produkt',
            name:           'language',
            hiddenName:     'language',
            displayField:   'name',
            valueField:     'value',
            store:          new Ext.data.JsonStore({
                fields : ['name', 'value'],
                data   : [
                    {name : 'German',   value: 'de'},
                    {name : 'English',  value: 'en'},
                    {name : 'French', value: 'fr'}
                ]
            })

        }],

What do I need to change so that the dropbox is right-aligned instead of left-aligned?

Addendum

thanks @dogbane, that works perfectly, here's how I right aligned both text and dropdown:

tbar: [
    {xtype: 'tbfill'},
    'Filters:',
    {
        width:          100,
        xtype:          'combo',
        mode:           'local',
        ...
like image 270
Edward Tanguay Avatar asked Feb 28 '11 11:02

Edward Tanguay


1 Answers

Try:

{xtype: 'tbfill'}, // or '->'

See the docs for Ext.Toolbar.Fill.

like image 55
dogbane Avatar answered Nov 01 '22 15:11

dogbane