View Full Version : [Closed]Grid returning empty string for a cell with value 0
surveyganga
26 Jul 2007, 10:15 AM
I have a grid with a NumberField editor for one of the columns. When I enter 0 in the cell it renders correctly but the datasource contains an empty string (""). I am using Ext1.1 rc1 then I switched back to the old version Ext1.01a and it works just fine. Is this a known bug in rc1? Is there a work around. I tried searching the forum but turned up nothing. Can some body throw some light on this one.
Ok. Found out another thread saying that its a bug http://extjs.com/forum/showthread.php?t=9855&highlight=numberfield
tryanDLS
26 Jul 2007, 10:28 AM
Confirmed - I see this with the EditGrid example price column in 1.1RC1. Moving to bugs.
mystix
27 Jul 2007, 9:08 AM
from the same thread above (http://extjs.com/forum/showthread.php?t=9855&highlight=numberfield):
This is fixed in SVN and will be in the next release.
arisbartee
18 Sep 2007, 8:18 AM
I'm using prototype 1.5.1. But I also tested it with ext.base adapter.
The value for Store.getModifiedRecords()[0].data["ID"] is zero. However it matches the empty string ("" or ''). This was reportedly fixed for 1.1.1 as per the release notes.
mystix
18 Sep 2007, 10:05 AM
pls post a complete test case (html file and all).
John Holmes
20 Sep 2007, 6:51 AM
Here an extraction from the Ext.debug.js from the Ext.form.Field object
getValue : function(){
return this.fixPrecision(this.parseValue(Ext.form.NumberField.superclass.getValue.call(this)));
},
parseValue : function(value){
return parseFloat(String(value).replace(this.decimalSeparator, ".")) || '';
},
The line of code...
return parseFloat(String(value).replace(this.decimalSeparator, ".")) || '';
..of the "parseValue" function force to return an empty value from the method call "Ext.form.Field.getValue()"
mystix
20 Sep 2007, 8:06 AM
the code in NumberField (in the Ext 1.1.1 official download) has already been fixed.
it now says this:
getValue : function(){
return this.fixPrecision(this.parseValue(Ext.form.NumberField.superclass.getValue.call(this)));
},
// private
parseValue : function(value){
value = parseFloat(String(value).replace(this.decimalSeparator, "."));
return isNaN(value) ? '' : value;
},
p.s. the code you copied and pasted is from Ext.form.Field.
achu_vlr
22 Jan 2009, 5:11 PM
Still the same problem exists. I am using ext 2.0
tryanDLS
22 Jan 2009, 5:15 PM
Still the same problem exists. I am using ext 2.0
This is a 1.x issue over a year old. If you still see in a issue in the 2.2 code, please create a new thread in 2.x Bugs with a test case per the link in my sig.
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.