+++ /dev/null
-/*\r
- * Ext JS Library 2.2.1\r
- * Copyright(c) 2006-2009, Ext JS, LLC.\r
- * licensing@extjs.com\r
- * \r
- * http://extjs.com/license\r
- */\r
-\r
-/**\r
- * @class Ext.form.Radio\r
- * @extends Ext.form.Checkbox\r
- * Single radio field. Same as Checkbox, but provided as a convenience for automatically setting the input type.\r
- * Radio grouping is handled automatically by the browser if you give each radio in a group the same name.\r
- * @constructor\r
- * Creates a new Radio\r
- * @param {Object} config Configuration options\r
- */\r
-Ext.form.Radio = Ext.extend(Ext.form.Checkbox, {\r
- // private\r
- inputType: 'radio',\r
- // private\r
- baseCls: 'x-form-radio',\r
- \r
- /**\r
- * If this radio is part of a group, it will return the selected value\r
- * @return {String}\r
- */\r
- getGroupValue : function(){\r
- var c = this.getParent().child('input[name='+this.el.dom.name+']:checked', true);\r
- return c ? c.value : null;\r
- },\r
- \r
- // private\r
- getParent : function(){\r
- return this.el.up('form') || Ext.getBody();\r
- },\r
-\r
- // private\r
- toggleValue : function() {\r
- if(!this.checked){\r
- var els = this.getParent().select('input[name='+this.el.dom.name+']');\r
- els.each(function(el){\r
- if(el.dom.id == this.id){\r
- this.setValue(true);\r
- }else{\r
- Ext.getCmp(el.dom.id).setValue(false);\r
- }\r
- }, this);\r
- }\r
- },\r
- \r
- /**\r
- * Sets either the checked/unchecked status of this Radio, or, if a string value\r
- * is passed, checks a sibling Radio of the same name whose value is the value specified.\r
- * @param value {String/Boolean} Checked value, or the value of the sibling radio button to check.\r
- */\r
- setValue : function(v){\r
- if(typeof v=='boolean') {\r
- Ext.form.Radio.superclass.setValue.call(this, v);\r
- }else{\r
- var r = this.getParent().child('input[name='+this.el.dom.name+'][value='+v+']', true);\r
- if(r && !r.checked){\r
- Ext.getCmp(r.id).toggleValue();\r
- };\r
- }\r
- },\r
- \r
- /**\r
- * Overridden and disabled. The editor element does not support standard valid/invalid marking. @hide\r
- * @method\r
- */\r
- markInvalid : Ext.emptyFn,\r
- /**\r
- * Overridden and disabled. The editor element does not support standard valid/invalid marking. @hide\r
- * @method\r
- */\r
- clearInvalid : Ext.emptyFn\r
- \r
-});\r
-Ext.reg('radio', Ext.form.Radio);\r