-
13 Dec 2007 2:11 AM #11
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
-
16 Dec 2007 12:42 PM #12
Bump for the sake of all that is holy
-
2 Jan 2008 2:09 PM #13
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'} ] }); });
-
3 Jan 2008 12:46 AM #14
This really works!
-
7 Jan 2008 11:49 PM #15
Thanks for the effort. Is this fix for Ext2.0?
Tried with 1.1.1 proj, looks like nothing changed.
-
9 Jan 2008 12:09 PM #16
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.
-
14 Jan 2008 9:06 AM #17
Why isn't this bug solved in the svn (2.0) release yet?
-
14 Jan 2008 9:14 AM #18
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.
-
14 Jan 2008 12:38 PM #19
-
15 Jan 2008 6:30 AM #20
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



