2013-07-17 31 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' } 
]