Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.
  1. #1
    Sencha User
    Join Date
    Jan 2012
    Location
    New York City
    Posts
    109
    Vote Rating
    2
    infernoz is on a distinguished road

      0  

    Default 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:

    Code:
     {name: 'statValueNumber', type: 'float', useNull: true}
    I specified the useNull config so null values would not show up as 0.

    Inside a gridPanel, I show the value of this field in this manner:

    Code:
     
    .....
    initComponent: function() {
            
             Ext.apply(this, {
                columns: {
                    items: [
                           .....
                          {header: 'STAT_VALUE_N', dataIndex: 'statValueNumber', flex: 3, editor: 'numberfield', hideable: false},
                          .......
                    ],
    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.

    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

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,046
    Vote Rating
    657
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    What JSON are you sending back?
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,046
    Vote Rating
    657
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    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);
    });
    Code:
    [{
        "f": 1
    }, {
        "f": null
    }]
    I don't see any logs.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  4. #4
    Sencha User
    Join Date
    Jan 2012
    Location
    New York City
    Posts
    109
    Vote Rating
    2
    infernoz is on a distinguished road

      0  

    Default


    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

  5. #5
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,046
    Vote Rating
    657
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    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!

  6. #6
    Sencha User
    Join Date
    Jan 2012
    Location
    New York City
    Posts
    109
    Vote Rating
    2
    infernoz is on a distinguished road

      0  

    Default


    Just looking back at my old bug posts. I believe this issue can be closed, it was most likely an issue on my side.

    Cheers,

    infernoz

Thread Participants: 1

Tags for this Thread