2013-07-17 29 views
0

我有一个带有一些按钮的工具栏。我想让工具栏中的按钮对齐到右侧。我怎样才能做到这一点 ?这是代码如何更改工具栏的对齐方式Ext JS

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 
}] 

回答

2

加入之前,你的其他按钮的Ext.toolbar.Fill

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

这个快捷方式是使用'->'

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