-
12 Dec 2011 9:19 AM #1
[PR3] selectfield getValues issue
[PR3] selectfield getValues issue
If the "value" config is passed to a selectfield, "getValue()" does not call the specified "getValue" function defined in Ext.field.Select (on line 49921 in sencha-touch-all-debug), but the optimizedGetter function (line 3285).
Maybe it's an even bigger problem for other fields or components, too.
Example:
Code:var fieldset = new Ext.form.Panel({ items: [{ xtype: 'fieldset', items: [{ xtype: 'selectfield', store: [...], value: 1 // this disturbs the config }] }] });
-
12 Dec 2011 10:03 AM #2Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,651
- Vote Rating
- 14
Thank you for the report.
-
12 Dec 2011 9:50 PM #3
Is there a workaround to get the value? I'm getting the same issue with sliderfields in a fieldset.
-
13 Dec 2011 3:32 AM #4
Another error on getValues is that a toogle returns now an Array and not the given value.
-
16 Dec 2011 2:49 AM #5
I too can reproduce the problem. See below on a snippet of my code on how I "worked" around the problem on PR3. on PR2 it works fine. If I don't set a default value then getValue(), works fine. Its only then you set a value you get returned a object which you have to go into. Unless I'm doing this wrong and its working by chance 100% of the time :-)
Code:{ xtype: 'selectfield', name : 'carriercountry', label: 'Country', valueField : 'countryid', displayField : 'countryname', value: country_code, store : CountriesStore, listeners: { change: function(newOption) { apncountry = newOption.getValue().data.countryid; // PR3 //apncountry = newOption.getValue(); // PR2 CarriersStore.read({ params : {country:apncountry} }); } } },
-
16 Dec 2011 4:05 AM #6
I had the same issue with a sliderfield.
As a workaround, I set the value using the setValue function instead of setting it through the config.
I'm guessing the issue happens because of automatic getter and setter functions set on each config, but I'm not sure as I don't know how that works.
If that's indeed the case, it should be fairly easy to fix, by checking if a function already exists with the same name before creating the getter or setter.---
Oussama Mubarak // Semiaddict
-
12 Jan 2012 3:46 PM #7Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,651
- Vote Rating
- 14
This issue has been fixed for the next release.
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-1238
in
2.0.


Reply With Quote