4 * Copyright(c) 2006-2007, Ext JS, LLC.
6 * Originally Released Under LGPL - original licence link has changed is not relivant.
9 * <script type="text/javascript">
13 * @class Roo.form.Radio
14 * @extends Roo.form.Checkbox
15 * Single radio field. Same as Checkbox, but provided as a convenience for automatically setting the input type.
16 * Radio grouping is handled automatically by the browser if you give each radio in a group the same name.
19 * @param {Object} config Configuration options
21 Roo.form.Radio = function(){
22 Roo.form.Radio.superclass.constructor.apply(this, arguments);
24 Roo.extend(Roo.form.Radio, Roo.form.Checkbox, {
28 * If this radio is part of a group, it will return the selected value
31 getGroupValue : function(){
32 return this.el.up('form').child('input[name='+this.el.dom.name+']:checked', true).value;
36 onRender : function(ct, position){
37 Roo.form.Checkbox.superclass.onRender.call(this, ct, position);
39 if(this.inputValue !== undefined){
40 this.el.dom.value = this.inputValue;
43 this.wrap = this.el.wrap({cls: "x-form-check-wrap"});
44 //this.wrap = this.el.wrap({cls: 'x-menu-check-item '});
45 //var viewEl = this.wrap.createChild({
46 // tag: 'img', cls: 'x-menu-item-icon', style: 'margin: 0px;' ,src : Roo.BLANK_IMAGE_URL });
47 //this.viewEl = viewEl;
48 //this.wrap.on('click', this.onClick, this);
50 //this.el.on('DOMAttrModified', this.setFromHidden, this); //ff
51 //this.el.on('propertychange', this.setFromHidden, this); //ie
56 this.wrap.createChild({tag: 'label', htmlFor: this.el.id, cls: 'x-form-cb-label', html: this.boxLabel});
57 // viewEl.on('click', this.onClick, this);
60 this.el.dom.checked = 'checked' ;