9 * @class Roo.bootstrap.RadioItem
10 * @extends Roo.bootstrap.Component
11 * Bootstrap RadioItem class
12 * @cfg {String} boxLabel - the label associated
13 * @cfg {String} value - the value of radio
16 * Create a new RadioItem
17 * @param {Object} config The config object
19 Roo.bootstrap.RadioItem = function(config){
20 Roo.bootstrap.RadioItem.superclass.constructor.call(this, config);
24 Roo.extend(Roo.bootstrap.RadioItem, Roo.bootstrap.Component, {
29 getAutoCreate : function()
33 cls : 'form-group radio roo-radio-set-item',
37 cls : 'roo-radio roo-radio-set-item-input',
43 cls : 'box-label roo-radio-set-item-box-label',
52 initEvents : function()
54 this.parent().register(this);
56 this.inputEl().on('click', this.onClick, this);
59 this.el.select('.roo-radio-set-item-box-label',true).first().on('click', this.onClick, this);
65 return this.el.select('.roo-radio-set-item-input', true).first();
70 this.setChecked(true);
73 setChecked : function(state, suppressEvent)
75 Roo.each(this.parent().items, function(i){
77 i.inputEl().dom.checked = false;
81 this.inputEl().dom.checked = state;
83 if(suppressEvent !== true){
84 this.fireEvent('check', this, state);
87 this.parent().validate();