如何更改工具栏Extjs的对齐方式

时间:2013-07-17 14:14:07

标签: extjs toolbar

我有一个带有一些按钮的工具栏。我希望工具栏中的按钮与右侧对齐。我怎样才能做到这一点 ?这是代码

items: [{
    xtype: 'toolbar',
    dock: 'top',
    buttonAlign: 'right', // This one does not wrok
    align: 'right', // This one does neither
    items: [{
        text: 'Foo1'
    }, {
        text: 'Foo2'
    }, {
        text: 'Foo3'
   }]
}, {
   // Some other items
}]

1 个答案:

答案 0 :(得分:2)

在其他按钮之前添加Ext.toolbar.Fill

items: [
    { xtype: 'tbfill' }, 
    { text: 'Foo1' }, 
    { text: 'Foo2' }, 
    { text: 'Foo3' }
]

此快捷方式是使用'->'

items: [
    '->', 
    { text: 'Foo1' }, 
    { text: 'Foo2' }, 
    { text: 'Foo3' }
]