X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..0494b8d9b9bb03ab6c22b34dae81261e3cd7e3e6:/docs/source/Radio.html diff --git a/docs/source/Radio.html b/docs/source/Radio.html index f551a2b2..6cba19ec 100644 --- a/docs/source/Radio.html +++ b/docs/source/Radio.html @@ -1,11 +1,18 @@ - - - The source code - - - - -
/** + + + + The source code + + + + +
/*!
+ * Ext JS Library 3.3.1
+ * Copyright(c) 2006-2010 Sencha Inc.
+ * licensing@sencha.com
+ * http://www.sencha.com/license
+ */
+
/** * @class Ext.form.Radio * @extends Ext.form.Checkbox * Single radio field. Same as Checkbox, but provided as a convenience for automatically setting the input type. @@ -39,20 +46,6 @@ Ext.form.Radio = Ext.extend(Ext.form.Checkbox, { return c ? c.value : null; }, - // private - onClick : function(){ - if(this.el.dom.checked != this.checked){ - var els = this.getCheckEl().select('input[name=' + this.el.dom.name + ']'); - els.each(function(el){ - if(el.dom.id == this.id){ - this.setValue(true); - }else{ - Ext.getCmp(el.dom.id).setValue(false); - } - }, this); - } - }, -
/** * Sets either the checked/unchecked status of this Radio, or, if a string value * is passed, checks a sibling Radio of the same name whose value is the value specified. @@ -60,26 +53,39 @@ Ext.form.Radio = Ext.extend(Ext.form.Checkbox, { * @return {Ext.form.Field} this */ setValue : function(v){ + var checkEl, + els, + radio; if (typeof v == 'boolean') { Ext.form.Radio.superclass.setValue.call(this, v); - } else { - var r = this.getCheckEl().child('input[name=' + this.el.dom.name + '][value=' + v + ']', true); - if(r){ - Ext.getCmp(r.id).setValue(true); + } else if (this.rendered) { + checkEl = this.getCheckEl(); + radio = checkEl.child('input[name=' + this.el.dom.name + '][value=' + v + ']', true); + if(radio){ + Ext.getCmp(radio.id).setValue(true); } } + if(this.rendered && this.checked){ + checkEl = checkEl || this.getCheckEl(); + els = this.getCheckEl().select('input[name=' + this.el.dom.name + ']'); + els.each(function(el){ + if(el.dom.id != this.id){ + Ext.getCmp(el.dom.id).setValue(false); + } + }, this); + } return this; }, - + // private getCheckEl: function(){ if(this.inGroup){ - return this.el.up('.x-form-radio-group') + return this.el.up('.x-form-radio-group'); } return this.el.up('form') || Ext.getBody(); } }); Ext.reg('radio', Ext.form.Radio); -
- +
+ \ No newline at end of file