Reputation: 1506
I'm not sure how to go about this, buttonAlign: 'center'
nor pack: 'center'
are working. Fiddle: http://jsfiddle.net/3Ytp9/
Upvotes: 0
Views: 2101
Reputation: 1951
Use the layout property of buttongroup:
layout: {
type: 'vbox',
align: 'center'
}
See forked fiddle: https://fiddle.sencha.com/#fiddle/1cm
Upvotes: 1
Reputation: 6034
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.
Upvotes: 1
Reputation: 71140
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.
Upvotes: 0