PDA

View Full Version : Form panel buttons alignment



extjser12
22 Mar 2012, 9:31 AM
Hi together

How do I have to change the following code, so that the buttons "Button Left 1" and "Button Left 2" will be aligned on the of the form and the buttons "Button Right 1" and "Button Right 2" will be aligned on the right of the form?


Ext.onReady(function () {
Ext.create('Ext.container.Viewport', {
layout: 'border',
items: [{
region: 'center',
border: false,
layout: 'fit',
items: [
form
]
}]
});
});

var form = Ext.create('Ext.form.Panel', {
frame:true,
title: 'Simple Form',
bodyStyle:'padding:5px 5px 0',
fieldDefaults: {
msgTarget: 'side',
labelWidth: 75
},
defaultType: 'textfield',
defaults: {
anchor: '100%'
},


items: [{
fieldLabel: 'First Name',
name: 'first',
allowBlank: false
},{
fieldLabel: 'Last Name',
name: 'last',
allowBlank: false
}],


buttons: [{
text: 'Button Left 1'
},{
text: 'Button Left 2'
},{
text: 'Button Right 1'
},{
text: 'Button Right 2'
}]
});



Thanks for your support!
extjser12

mitchellsimoens
22 Mar 2012, 1:17 PM
Try inserting a spacer component to space out the buttons.

khmurach
22 Mar 2012, 1:31 PM
Like here http://ext4all.com/post/form-panel-buttons-alignment