I'm not sure how to go about this, buttonAlign: 'center'
nor pack: 'center'
are working. Fiddle: http://jsfiddle.net/3Ytp9/
Asked
Active
Viewed 2,045 times
0

mustafa.0x
- 1,476
- 2
- 17
- 30
3 Answers
1
Have you considered using a toolbar in the bottom of your panel?
https://fiddle.sencha.com/#fiddle/1c0 (without mvc pattern)
You can also use something like this:
dockedItems: [{
xtype: 'toolbar',
layout: {
pack: 'center'
},
defaultButtonUI: 'default', // get default look and feel
dock: 'bottom',
items: [{
xtype: 'button',
width: 200,
text: 'Download to Excel',
},{
xtype: 'button',
width: 200,
text: 'Another action',
}]
Best Regards.

code4jhon
- 5,725
- 9
- 40
- 60
-
Hm, any way to center them without using a docked toolbar? – mustafa.0x Nov 05 '13 at 06:24
1
Use the layout property of buttongroup:
layout: {
type: 'vbox',
align: 'center'
}
See forked fiddle: https://fiddle.sencha.com/#fiddle/1cm

mustafa.0x
- 1,476
- 2
- 17
- 30

newmount
- 1,921
- 1
- 12
- 10
0
Try:
Ext.onReady(function() {
var panel = Ext.create('Ext.form.Panel', {
renderTo: Ext.getBody(),
title: 'Button group',
border: true,
layout: {
align: 'middle',
pack: 'center',
type: 'hbox'
},
width: 500,
items: [{
xtype: 'buttongroup',
columns: 1,
items: [{
xtype: 'button',
text: 'Go'
}, {
xtype: 'button',
text: 'Reset'
}]
}]
});
});
To have the buttons side by side, remove columns:1
- also note that the Ext JS implementation on JSFiddle is terrible, so dont rely on it too much.

SW4
- 69,876
- 20
- 132
- 137