1 <!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-form.RadioGroup-method-constructor'><span id='Ext-form.RadioGroup'>/**
2 </span></span> * @class Ext.form.RadioGroup
3 * @extends Ext.form.CheckboxGroup
4 * <p>A {@link Ext.form.FieldContainer field container} which has a specialized layout for arranging
5 * {@link Ext.form.field.Radio} controls into columns, and provides convenience {@link Ext.form.field.Field} methods
6 * for {@link #getValue getting}, {@link #setValue setting}, and {@link #validate validating} the group
7 * of radio buttons as a whole.</p>
8 * <p><b>Validation:</b> Individual radio buttons themselves have no default validation behavior, but
9 * sometimes you want to require a user to select one of a group of radios. RadioGroup
10 * allows this by setting the config <tt>{@link #allowBlank}:false</tt>; when the user does not check at
11 * one of the radio buttons, the entire group will be highlighted as invalid and the
12 * {@link #blankText error message} will be displayed according to the {@link #msgTarget} config.</p>
13 * <p><b>Layout:</b> The default layout for RadioGroup makes it easy to arrange the radio buttons into
14 * columns; see the {@link #columns} and {@link #vertical} config documentation for details. You may also
15 * use a completely different layout by setting the {@link #layout} to one of the other supported layout
16 * types; for instance you may wish to use a custom arrangement of hbox and vbox containers. In that case
17 * the Radio components at any depth will still be managed by the RadioGroup's validation.</p>
18 * <p>Example usage:</p>
19 * <pre><code>
20 var myRadioGroup = new Ext.form.RadioGroup({
23 fieldLabel: 'Single Column',
24 // Arrange radio buttons into three columns, distributed vertically
28 {boxLabel: 'Item 1', name: 'rb', inputValue: '1'},
29 {boxLabel: 'Item 2', name: 'rb', inputValue: '2', checked: true},
30 {boxLabel: 'Item 3', name: 'rb', inputValue: '3'}
31 {boxLabel: 'Item 4', name: 'rb', inputValue: '4'}
32 {boxLabel: 'Item 5', name: 'rb', inputValue: '5'}
33 {boxLabel: 'Item 6', name: 'rb', inputValue: '6'}
36 * </code></pre>
38 * Creates a new RadioGroup
39 * @param {Object} config Configuration options
42 Ext.define('Ext.form.RadioGroup', {
43 extend: 'Ext.form.CheckboxGroup',
44 alias: 'widget.radiogroup',
46 <span id='Ext-form.RadioGroup-cfg-items'> /**
47 </span> * @cfg {Array} items An Array of {@link Ext.form.field.Radio Radio}s or Radio config objects
48 * to arrange in the group.
50 <span id='Ext-form.RadioGroup-cfg-allowBlank'> /**
51 </span> * @cfg {Boolean} allowBlank True to allow every item in the group to be blank (defaults to true).
52 * If allowBlank = false and no items are selected at validation time, {@link @blankText} will
53 * be used as the error text.
56 <span id='Ext-form.RadioGroup-cfg-blankText'> /**
57 </span> * @cfg {String} blankText Error text to display if the {@link #allowBlank} validation fails
58 * (defaults to 'You must select one item in this group')
60 blankText : 'You must select one item in this group',
63 defaultType : 'radiofield',
66 groupCls : Ext.baseCSSPrefix + 'form-radio-group',
68 getBoxes: function() {
69 return this.query('[isRadio]');
73 </pre></pre></body></html>