Just encountered the same bug. So bump from me too.
A working Ext 1.1.1 patch exists, you can can find it here: http://extjs.com/forum/showthread.php?t=11620
Just encountered the same bug. So bump from me too.
A working Ext 1.1.1 patch exists, you can can find it here: http://extjs.com/forum/showthread.php?t=11620
Bump for the sake of all that is holy
Hey everyone, sorry for the delay in getting to this one. Try this override and let me know what you think:
Here's a simple test case:Code:Ext.override(Ext.form.Radio, {
onClick : function(){
if(this.el.dom.checked != this.checked){
var els = this.el.up('form').select('input[name='+this.el.dom.name+']');
els.each(function(el){
if(el.dom.id == this.id){
this.setValue(true);
}else{
Ext.getCmp(el.dom.id).setValue(false);
}
}, this);
}
}
});
Code:Ext.onReady(function(){
var simple = new Ext.form.FormPanel({
bodyStyle: 'padding:15px',
labelWidth: 75,
width: 400,
height: 150,
renderTo: document.body,
items: [{
xtype: 'radio',
fieldLabel: 'Browser',
boxLabel: 'Internet Explorer',
inputValue: 'IE',
id: 'browserGroupIE',
name: 'browserGroup',
checked: true
},{
xtype: 'radio',
labelSeparator: '',
boxLabel: 'Firefox',
inputValue: 'FF',
id: 'browserGroupFF',
name: 'browserGroup',
checked: false
},{
xtype: 'radio',
labelSeparator: '',
boxLabel: 'Other',
inputValue: 'Other',
id: 'browserGroupOther',
name: 'browserGroup',
checked: false,
listeners: {
check: function(cb, checked) {
Ext.getCmp('nameField').setVisible(checked);
}
}
},{
xtype: 'textfield',
fieldLabel: '',
labelSeparator: '',
name: 'nameField',
id: 'nameField',
hidden: true,
width: 220
}],
buttons: [
{text:'Save'},
{text:'Cancel'}
]
});
});
This really works!
Thanks for the effort. Is this fix for Ext2.0?
Tried with 1.1.1 proj, looks like nothing changed.
Works for me, although I had to add fireEvent("check") at the end of the for-each loop so that my event handler would run.
Why isn't this bug solved in the svn (2.0) release yet?
Just haven't checked it in yet. I was also wanting to patch 1.1, and just haven't gotten back to it. I'll check it in shortly.
Thanks for the fix!
This override assumes that the radios are being used in a form.
What about a toolbar or something all together different?
EDIT: I wrote an extension for (multiple) radios. Each radio with the same name fires the events and it is form load and submit friendly.Code:Ext.override(Ext.form.Radio, {
onClick : function(){
if(this.el.dom.checked != this.checked){
var p=this.el.up('form');
if(!p)p=Ext.fly(document.body); //if this radio doesn't belong to a form then search the body
var els = p.select('input[name='+this.el.dom.name+']');
els.each(function(el){
if(el.dom.id == this.id){
this.setValue(true);
}else{
Ext.getCmp(el.dom.id).setValue(false);
}
}, this);
}
}
});
http://extjs.com/forum/showthread.php?t=23250