PDA

View Full Version : how to align the submit button to center ?



Marysmitha
1 Feb 2011, 6:50 AM
Hi,

How to align the submit button to the center of the form by default the button is at left side.....

Condor
1 Feb 2011, 7:01 AM
Configure the form with:

buttonAlign: 'center'

Marysmitha
1 Feb 2011, 7:16 AM
Configure the form with:

buttonAlign: 'center'

Well that works fine for a window but buttonAlign:'center' is not working for a form ...can u tell me wat to do for a form?

Condor
1 Feb 2011, 7:31 AM
Should work for a form too (as long as the form has a width set, either specified or assigned by it's container layout).

Marysmitha
1 Feb 2011, 10:53 PM
Should work for a form too (as long as the form has a width set, either specified or assigned by it's container layout).

my form width is not specified but it is assigned by the container layout.....what should i do to align my button to center during this situation? where buttonAlign:'center' is not working ???????????

Condor
2 Feb 2011, 12:18 AM
Could you post your layout code?

Marysmitha
2 Feb 2011, 12:34 AM
Could you post your layout code?

My layout code is quite big iam posting east region where my button is present....

{
region:'east',
xtype:'tabpanel',
frame:true,
width:610,
activeTab:0,
items:
[
{
title:'Partner Information',
xtype:'form',
autoHeight:true,
frame:true,
activeTab:0,
items:
[
{
xtype:'textfield',
fieldLabel: 'Partner Name ',
labelSeparator:':'+ '<span class="asterisk">*</span>',
labelStyle:'width:180;',
width:335,
height:22
},
{
xtype:'textfield',
fieldLabel:'Site Code',
labelStyle:'width:180;',
width:335,
height:22
},
{
xtype:'textfield',
fieldLabel:'BU Name',
labelStyle:'width:180;',
width:335,
height:22
},
{
xtype:'textfield',
fieldLabel:'Organization Address1',
labelSeparator:':'+'<span class="asterisk">*</span>',
labelStyle:'width:180;',
width:335,
height:22
},
{
xtype:'textfield',
fieldLabel:'Organization Address2',
labelStyle:'width:180;',
width:335,
height:22
},
{
xtype:'textfield',
fieldLabel:'City',
labelSeparator:':'+'<span class="asterisk">*</span>',
labelStyle:'width:180;',
width:335,
height:22
},
{
xtype:'textfield',
fieldLabel:'Postal Code',
labelSeparator:':'+'<span class="asterisk">*</span>',
labelStyle:'width:180;',
width:335,
height:22
},
{
xtype:'textfield',
fieldLabel:'State',
width:335,
labelStyle:'width:180;',
height:22
},
{
xtype:'textfield',
fieldLabel:'Country',
labelSeparator:':'+'<span class="asterisk">*</span>',
labelStyle:'width:180;',
width:335,
height:22
},
{
xtype:'textfield',
fieldLabel:'Province',
labelStyle:'width:180;',
width:335,
height:22
},
{
xtype:'textarea',
fieldLabel:'Description',
labelStyle:'width:180;',
width:335,
height:60
},
{
xtype:'textfield',
fieldLabel:'Last updated by',
disabled:true,
labelStyle:
'width:180;',
width:335,
height:22
},
{
xtype:'combo',
fieldLabel:'Parent Partner',
editable:false,
labelStyle:'width:180;',
emptyText:'Select Partner Name',
width:335,
height:22
},
{
buttons:
[
{
text:'Save Partner Information',
disabled:true
}
}
]
}
]
},

Condor
2 Feb 2011, 1:22 AM
If you align that properly you spot the error instantly:

{
...
items: [{
...
items: [{
...
}, {
buttons: [{
...
}
}]
}]
},
should be:

{
...
items: [{
...
items: [{
...
}],
buttons: [{
...
}]
},