O'Reilly logo

Ext JS 4 Web Application Development Cookbook by Stuart Ashworth, Andrew Duncan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Displaying radio buttons in columns

Displaying radio buttons in columns is an easy task with Ext JS 4. This recipe aims to demonstrate how to render your radio buttons in columns both horizontally and vertically.

How to do it...

  1. Create a RadioGroup using the default layout:
    var radioGroupAutoLayout = Ext.create('Ext.form.Panel', {
        title: 'Radio Group Columns',
        width: 500,
        autoHeight: true,
        bodyPadding: 10,
        items: [{
            xtype: 'radiogroup',
            fieldLabel: 'Gender',
            items: [{
                boxLabel: 'Male',
                name: 'gender',
                inputValue: 'male'
            }, {
                boxLabel: 'Female',
                name: 'gender',
                inputValue: 'female'
            }]
        }],
        renderTo: Ext.getBody(),
        style: 'margin: 50px'
    });
    How to do it...
  2. Create a RadioGroup ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required