-
12 Jul 2012 1:17 PM #1
Error in Firefox null using float field
Error in Firefox null using float field
Hello,
I am using ExtJS 4.1.0. and I am testing out in Firefox 13.0.1
I have a float field set up in one of my models defined as such:
I specified the useNull config so null values would not show up as 0.Code:{name: 'statValueNumber', type: 'float', useNull: true}
Inside a gridPanel, I show the value of this field in this manner:
The grid panel is being populated via data from my server using a store that accepts json formatted data. In some cases this particular field above is null.Code:..... initComponent: function() { Ext.apply(this, { columns: { items: [ ..... {header: 'STAT_VALUE_N', dataIndex: 'statValueNumber', flex: 3, editor: 'numberfield', hideable: false}, ....... ],
Ever since I set the useNull config to true, I am receiving the following repeating error in firefox's firebug:
An invalid or illegal string was specified
The same code in IE does not throw an error.
This seems to just be a nuisance but I'd rather not see it continuously pop up. I dont believe anything is configured incorrectly, I'd just rather not see a value in my panel rather than the default of 0 if this field is null. I could also configure this field to be a String instead, but I'd rather not do this.
Please let me know your thoughts on this error I am getting from firebug
Cheers,
infernoz
-
12 Jul 2012 3:08 PM #2
What JSON are you sending back?
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
13 Jul 2012 12:00 AM #3
Using:
Code:Ext.define('MyModel', { extend: 'Ext.data.Model', fields: [{ name: 'f', type: 'float', useNull: true }] }); Ext.onReady(function(){ var s = Ext.create('Ext.data.Store', { autoLoad: true, model: MyModel, proxy: { type: 'ajax', url: 'data.json', reader: { type: 'json' } } }); setTimeout(function(){ s.each(function(rec){ console.log(rec.get('f')); }); }, 1000); });I don't see any logs.Code:[{ "f": 1 }, { "f": null }]Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
13 Jul 2012 9:03 AM #4
Field in json is null, see below in bold -
{"id":"ABC",
"anotherId":"ABC",
"updateId":"DEF",
"startDate":"11/27/2007 05:23:01",
"endDate":null,
"updateDate":"11/27/2007 05:23:01",
"deleteRow":false,
"newRecord":false,
"thirdid":"133",
"idType":"A",
"searchId":"111",
"searchIdType":"YYY",
"statValueString":null,
"statValueNumber":null,
"statValueDate":"05/15/2012 00:00:00",
"statCode":"DTE"}
Just in case its needed, here is the proxy I am using
proxy: {
type: 'ajax',
url: '/myTool/submit.html',
reader: {
type: 'json',
root: 'data'
},
writer: {
type: 'json',
root: 'data',
encode: true,
writeAllFields: true
},
extraParams: {'processorType': 'statistics'}Last edited by infernoz; 13 Jul 2012 at 9:06 AM. Reason: adding proxy code
-
13 Jul 2012 5:50 PM #5
I'm not able to reproduce it, I don't see any logs in the console when I run my example code.
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.


Reply With Quote