-
24 Feb 2012 11:28 AM #11Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,117
- Vote Rating
- 453
- Answers
- 3160
Please stop just blindly throwing code in. You have to define the form variable which equals btn.up('formpanel');
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
24 Feb 2012 12:34 PM #12
For what it is worth, the for loop didn't work here.
i.e. all of this..did NOT work - for whatever reason... 'fields.length' kept returning '0':
However, what DID work though was form.getValues();Code:var fields = form.query('numberfields'), f = 0, fNum = fields.length, sum = 0; for (; f < fNum; f++) { sum += fields[f].getValue(); }
i.e. this snippet:
So maybe you might want to update the 'accepted answer' for this question.Code:handler: function(btn) { form = btn.up('formpanel'); var values = form.getValues(); sum = (values.Num1 + values.Num2 + values.Num3 + values.Num4);
Thanks!
-
24 Feb 2012 12:36 PM #13Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,117
- Vote Rating
- 453
- Answers
- 3160
There was a typo... instead of numberfields it should be numberfield.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.


Reply With Quote