View Full Version : [1.1 beta 2] Calling reset() on blank NumberField produces NaN

3 Jul 2007, 5:23 AM

If you add a blank Ext.form.NumberField to a form and then call "reset()" on that field, the text "NaN" displays instead of blank text.

This behavior happens only in 1.1 beta 2. I do not see this in 1.1 beta 1. Perhaps Revision 539 in SVN caused it?

To recreate:
1. Edit "dynamic.js" that ships with the examples for Ext 1.1 beta 2.
2. At line 229, add:

new Ext.form.NumberField({
fieldLabel: 'MyTest',
name: 'mytest'

3. At the end of the file (line 299), add:

var field = form.findField('mytest');

4. load the page

I'll attach a screen shot and the code as well for convenience.

3 Jul 2007, 5:30 AM
Added attachments.

3 Jul 2007, 3:34 PM
Can you verify against the latest revision? Thanks.

5 Jul 2007, 5:18 AM
The bug is fixed.

Verified against svn revision 672.

Thanks Jack!

7 Jul 2007, 11:45 AM
Would someone care to share the fix for this bug, for those of us who can't currently afford SVN access? Thanks!

9 Jul 2007, 6:04 AM
NumberField reset bug is affecting a project for which I am using 1.1 Beta 2. Any idea, when this fix going to be released? Is there a nightly build that we can get access to?


9 Jul 2007, 6:17 AM
I hacked a fix for this. In absence of official fix, this should help - it does in my project. Attached screenshot shows line #'s to modify in ext-all-debug.js.

var value = String(value).replace(this.decimalSeparator, ".");
if (value != ''){
return parseFloat(value);
return '';