PDA

View Full Version : Display Label right of a checkbox



Urkman
2 Dec 2009, 2:31 AM
Hello,

I would like to display the label of a checkbox on the right side of it.
How can I do this?

Thanks,
Urkman

attu
2 Dec 2009, 2:56 AM
Hi!
Just define it like this:


{
id: 'id',
xtype:'checkbox',
name: 'name',
labelSeparator: '',
hideLabel: true,
boxLabel: 'text',
fieldLabel: 'text'
}
Bye!

Urkman
2 Dec 2009, 3:52 AM
works great :-)

Thanks,
Urkman

emkramer
8 Jun 2011, 5:11 AM
When I put the labels on the right it skews the whole field to the right. Is there a way to put the label on the right of a radio button but keep it aligned on the left?

emkramer
8 Jun 2011, 5:28 AM
Here is the code:

var Radio1 = new Ext.form.Radio({
name: 'group1',
fieldLabel: 'Radio 1'
});

var RadioPanel = new Ext.form.FormPanel({
items : [Radio1]
labelAlign: 'right'
});

I am assuming that labelAlign means, 'put the label of the button on the right. It puts it on the right but it aligns the whole field , button and lable, to the right of the panel leaving empty space on the left. I would have thought it would just put the label on the right

attu
8 Jun 2011, 5:32 AM
Hi emkramer,

Can you show us an example of what you have in a capture?

Bye!

emkramer
8 Jun 2011, 5:35 AM
interesting, I just tried your example and t works, so then I set mine up the same way, no outer panel, and that worked too - I guess putting them in the panel in another panel messed up the layout

Thanks for the quick reply!

attu
8 Jun 2011, 5:38 AM
Cheers!