X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=docs%2Fsrc%2FRoo_bootstrap_Radio.js.html;fp=docs%2Fsrc%2FRoo_bootstrap_Radio.js.html;h=a3ed6bcb9aea2b47d19cf668ca22339bfafef430;hb=9ff8ded6bbbd258ecd646184ba26020874e2c085;hp=0000000000000000000000000000000000000000;hpb=2542b67d1a0768025056f2f330bfe50b64d1ad38;p=roojs1 diff --git a/docs/src/Roo_bootstrap_Radio.js.html b/docs/src/Roo_bootstrap_Radio.js.html new file mode 100644 index 0000000000..a3ed6bcb9a --- /dev/null +++ b/docs/src/Roo_bootstrap_Radio.js.html @@ -0,0 +1,80 @@ +/home/alan/gitlive/roojs1/Roo/bootstrap/Radio.js/* + * - LGPL + * + * RadioItem + * + */ + +/** + * @class Roo.bootstrap.Radio + * @extends Roo.bootstrap.Component + * Bootstrap Radio class + * @cfg {String} boxLabel - the label associated + * @cfg {String} value - the value of radio + * + * @constructor + * Create a new Radio + * @param {Object} config The config object + */ +Roo.bootstrap.Radio = function(config){ + Roo.bootstrap.Radio.superclass.constructor.call(this, config); + +}; + +Roo.extend(Roo.bootstrap.Radio, Roo.bootstrap.Component, { + + boxLabel : '', + + value : '', + + getAutoCreate : function() + { + var cfg = { + tag : 'div', + cls : 'form-group radio', + cn : [ + { + tag : 'label', + cls : 'box-label', + html : this.boxLabel + } + ] + }; + + return cfg; + }, + + initEvents : function() + { + this.parent().register(this); + + this.el.on('click', this.onClick, this); + + }, + + onClick : function(e) + { + if(this.parent().fireEvent('click', this.parent(), this, e) !== false){ + this.setChecked(true); + } + }, + + setChecked : function(state, suppressEvent) + { + this.parent().setValue(this.value, suppressEvent); + + }, + + setBoxLabel : function(v) + { + this.boxLabel = v; + + if(this.rendered){ + this.el.select('label.box-label',true).first().dom.innerHTML = (v === null || v === undefined ? '' : v); + } + } + +}); + + + \ No newline at end of file