3 <title>The source code</title>
\r
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
7 <body onload="prettyPrint();">
\r
8 <pre class="prettyprint lang-js"><div id="cls-Ext.form.RadioGroup"></div>/**
9 * @class Ext.form.RadioGroup
10 * @extends Ext.form.CheckboxGroup
11 * A grouping container for {@link Ext.form.Radio} controls.
13 * Creates a new RadioGroup
14 * @param {Object} config Configuration options
17 Ext.form.RadioGroup = Ext.extend(Ext.form.CheckboxGroup, {
18 <div id="cfg-Ext.form.RadioGroup-allowBlank"></div>/**
19 * @cfg {Boolean} allowBlank True to allow every item in the group to be blank (defaults to true).
20 * If allowBlank = false and no items are selected at validation time, {@link @blankText} will
21 * be used as the error text.
24 <div id="cfg-Ext.form.RadioGroup-blankText"></div>/**
25 * @cfg {String} blankText Error text to display if the {@link #allowBlank} validation fails
26 * (defaults to 'You must select one item in this group')
28 blankText : 'You must select one item in this group',
31 defaultType : 'radio',
34 groupCls : 'x-form-radio-group',
36 <div id="event-Ext.form.RadioGroup-change"></div>/**
38 * Fires when the state of a child radio changes.
39 * @param {Ext.form.RadioGroup} this
40 * @param {Ext.form.Radio} checked The checked radio
43 <div id="method-Ext.form.RadioGroup-getValue"></div>/**
44 * Gets the selected {@link Ext.form.Radio} in the group, if it exists.
45 * @return {Ext.form.Radio} The selected radio.
47 getValue : function(){
49 this.eachItem(function(item){
58 <div id="method-Ext.form.RadioGroup-setValue"></div>/**
59 * Sets the checked radio in the group.
60 * @param {String/Ext.form.Radio} id The radio to check.
61 * @param {Boolean} value The value to set the radio.
62 * @return {Ext.form.RadioGroup} this
64 setValue : function(id, value){
66 if(arguments.length > 1){
67 var f = this.getBox(id);
71 this.eachItem(function(item){
79 this.setValueForItem(id);
82 this.values = arguments;
88 fireChecked : function(){
90 this.checkTask = new Ext.util.DelayedTask(this.bufferChecked, this);
92 this.checkTask.delay(10);
96 bufferChecked : function(){
98 this.eachItem(function(item){
104 this.fireEvent('change', this, out);
107 onDestroy : function(){
109 this.checkTask.cancel();
110 this.checkTask = null;
112 Ext.form.RadioGroup.superclass.onDestroy.call(this);
117 Ext.reg('radiogroup', Ext.form.RadioGroup);