-
28 Aug 2009 1:53 PM #1
[FIXED-206][3.0+] radioGroup value config doesn't set the value, but setValue() works
[FIXED-206][3.0+] radioGroup value config doesn't set the value, but setValue() works
B]Ext version tested:[/B]
Ext 3.0+ SVN rev 5146
Adapter used:
jquery
css used:
only default ext-all.css
Browser versions tested against:
FF3
Operating System:
Ubuntu
Description:
radioGroup value config does not set the value, but the setValue() works fine.
Test Case:
which does not pre-check off 'Ascending', but doing:Code:Ext.onReady(function(){ // Ext.QuickTips.init(); Ext.BLANK_IMAGE_URL = 'images/s.gif'; Ext.QuickTips.init(); var radiogroup = new Ext.form.RadioGroup({ renderTo: 'radio_holder', fieldLabel: 'Sort by direction', name: 'sort_1_dir', id: 'first_radio', value: 'asc', items: [{ boxLabel: 'Ascending', inputValue: 'asc', id: 'asc' },{ boxLabel: 'Descending', inputValue: 'desc' }] }) });
in firebug after the page loads works fineCode:Ext.getCmp('first_radio').setValue('asc');
-
28 Aug 2009 1:54 PM #2
hrmm that didn't work well. I've been having all sorts of problems with the bulletin board in the last day or so...but I think its readable.
-
30 Aug 2009 5:11 AM #3
Maybe this falls more under documentation problem than bug, try this:
Code:Ext.onReady(function(){ Ext.QuickTips.init(); // combine all that into one huge form var fp = new Ext.FormPanel({ title: 'Check/Radio Groups Example', frame: true, labelWidth: 110, width: 600, renderTo: 'form-ct', bodyStyle: 'padding:0 10px 0;', items: [ new Ext.form.RadioGroup({ fieldLabel: 'Sort by direction', name: 'sort_1_dir', id: 'first_radio', values: ['asc'], items: [{ boxLabel: 'Ascending', inputValue: 'asc', id: 'asc' }, { boxLabel: 'Descending', inputValue: 'desc' }] }) ] }); });MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
30 Aug 2009 6:18 AM #4
Ok tested and your suggestion works. It looks to be a documentation bug since 'values' is not listed as a config option but 'value' is. I'll post this to the documentation thread.
-
30 Aug 2009 10:03 AM #5
No. This is a double bug.
- RadioGroup.setValues() should be set to emptyFn. (values config option makes no sense)
- Ext.form.RadioGroup.initValue() needs to be re-implemented, since Ext.form.RadioGroup inherits from Ext.form.CheckboxGroup, and Ext.form.CheckboxGroup.initValue == emptyFn. (overwrites Ext.form.Field.initValue() which hence can't be inherited)
-
30 Aug 2009 7:32 PM #6
Fix applied to svn in rev #5241 for patch release 3.0.2.
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
1 Oct 2009 4:16 AM #7
FIX INCOMPLETE
FIX INCOMPLETE
The fix in place does not fully comply with how fields work.
It does NOT set the originalValue for the individual radio controls, thus it breaks the isDirty() functionality when the initial value for a RadioGroup/CheckboxGroup is set via the value config parameter.
Is this a known limitation?
Any fixes/overrides available?
Thanks
Stefan
Thank you for reporting this bug. We will make it our priority to review this report.



Reply With Quote