PDA

View Full Version : aligning buttons right in hbox fieldset



andynuss
21 Feb 2010, 7:12 AM
Hi,

I have a form, and its last item is a fieldset container which tries to divide an hbox into 3 equal partitions, and the third has 2 buttons that I want aligned right instead of left. When I try the following code, my buttons are aligned left in their fieldset partition, instead of right. Also, I don't know how to insert some spacing between my 2 buttons:



{
xtype : 'container',
layout : 'hbox',
height : 45,
layoutConfig : {
align : 'stretch',
},
items : [{
xtype : 'fieldset',
flex : 1,
border : false,
items : [{
id : 'form-story-ispublic',
fieldLabel : 'Is public',
checked : true,
xtype : 'checkbox',
anchor : '100%',
}],
},{
xtype : 'fieldset',
flex : 1,
border : false,
items : [{
id : 'form-story-isshareable',
fieldLabel : 'Is shareable',
checked : true,
xtype : 'checkbox',
anchor : '100%',
}],
},{
xtype : 'fieldset',
flex : 1,
border : false,
items : [{
xtype : 'container',
layout : 'hbox',
items : [{
width : 60,
text : 'Save',
xtype : 'button',
},{
width : 60,
text : 'Cancel',
xtype : 'button',
}],
}],
}],
}


How do I get my Save, Cancel buttons to align right in the third fieldset and insert spacing between the 2 buttons?

Andy