PDA

View Full Version : Radio buttons in multiple lines



rosez
16 Sep 2011, 12:04 AM
Hello,
I need to display a group of radio buttons in multiple lines in a FormPanel, how can i do it? I have 16 radio buttons and i can't leave it in a single line.

catalin.ciobanu
16 Sep 2011, 1:54 AM
you should take a look over the layouts here (http://sencha.com/examples/#overview%20)and chose the one that fits best for your needs

rosez
16 Sep 2011, 3:45 AM
Radio rd1=new Radio();
Radio rd2=new Radio();
Radio rd3=new Radio();
Radio rd4=new Radio();

RadioGroup grp = new RadioGroup();
grp.add(rd1);
grp.add(rd2);
grp.add(rd3);
grp.add(rd4);
form.add(grp);

ok, this is the normal usage using Radio buttons and forms. Add RadioGroup which contains all radio buttons to the form. How can i draw those 4 radio buttons into two lines -instead of one- in my form?


Catalin I don't understand how it helps with the solution:-?

catalin.ciobanu
16 Sep 2011, 3:59 AM
For a fast but not so elegant solving, you could do 2 groups of radios ... I just hope that's not the only solution.

rosez
16 Sep 2011, 4:10 AM
This solution is ok but you will lose the mutually exclusive behaviour...but maybe you can do it manually.

catalin.ciobanu
16 Sep 2011, 4:16 AM
Well I think the only implemented control over the "looks" of a RadioGroup it's this one:


setOrientation( ------ ) Orientation.HORIZONTAL/Orientation.VERTICAL

To control each of the members ... that's difficult if not impossible.

rosez
16 Sep 2011, 4:21 AM
Orientation fails to solve my issue. Actually is something different

faddap
30 Jan 2012, 1:02 AM
Hello,

I just have been searching about a solution to the same problem and just wanted to inform you, that
{
...
xtype: 'radiogroup',
columns: 1,
items: [...]
...
}
did the trick for me.

Good luck,
Ivan