* @extends Roo.bootstrap.Component
* Bootstrap Radio class
* @cfg {String} boxLabel - the label associated
- * @cfg {String} inputValue - the value of radio
+ * @cfg {String} value - the value of radio
*
* @constructor
* Create a new Radio
boxLabel : '',
- inputValue : '',
+ value : '',
getAutoCreate : function()
{
{
tag : 'label',
cls : 'box-label',
- html : this.inputValue
+ html : this.boxLabel
}
]
};
},
- onClick : function()
+ onClick : function(e)
{
- this.setChecked(true);
+ if(this.parent().fireEvent('click', this.parent(), this, e) !== false){
+ this.setChecked(true);
+ }
},
setChecked : function(state, suppressEvent)
{
- this.parent().setValue(this.inputValue);
+ this.parent().setValue(this.value, suppressEvent);
- if(suppressEvent !== true){
- this.fireEvent('check', this, state);
- }
+ },
+
+ setBoxLabel : function(v)
+ {
+ this.boxLabel = v;
+ if(this.rendered){
+ this.el.select('label.box-label',true).first().dom.innerHTML = (v === null || v === undefined ? '' : v);
+ }
}
});