1. #1
    Sencha User andy370's Avatar
    Join Date
    Jul 2012
    Posts
    13
    Answers
    2
    Vote Rating
    1
    andy370 is on a distinguished road

      0  

    Default Unanswered: Uncaught TypeError on date field when jsonp returns null value

    Unanswered: Uncaught TypeError on date field when jsonp returns null value


    My model:
    Code:
    Ext.define('MyApp.model.InvoiceLookup_Model', {
        extend: 'Ext.data.Model',
        config: {
            fields: [{
                    name: 'invoiceId'
                },{
                    name: 'transactionDate',
                    type: 'date'
                },{
                    name: 'invoiceNumber'
                },{
                    name: 'invoiceTotal'
                },{
                    name: 'invoiceStatus'
                }
    ]}});
    gets populated via jsonp:
    Code:
    {"invoiceId":null,"invoiceTotal":null,"invoiceNumber":null,"invoiceStatus":null,"transactionDate":null}
    gives me this error:
    Code:
    Uncaught TypeError: Cannot call method 'toString' of null sencha-touch-all-debug.js:18098
     Ext.apply.DATE.convert sencha-touch-all-debug.js:18098
     Ext.define.setData sencha-touch-all-debug.js:66568
     Ext.define.constructor sencha-touch-all-debug.js:66474
     Class sencha-touch-all-debug.js:4913
     Ext.define.processRead sencha-touch-all-debug.js:17511
     Ext.define.process sencha-touch-all-debug.js:17499
     Ext.define.processResponse sencha-touch-all-debug.js:43784
     (anonymous function) sencha-touch-all-debug.js:44215
     Ext.apply.callback sencha-touch-all-debug.js:9475
     Ext.define.handleResponse sencha-touch-all-debug.js:17143
     (anonymous function) sencha-touch-all-debug.js:3149
     (anonymous function) Mobile:1
    But the error (and formatting on non-null records) goes away if I take away the type: 'date' property. Is this a bug or am I doing something wrong?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,754
    Answers
    3462
    Vote Rating
    827
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    With this store:

    Code:
    new Ext.data.Store({
        autoLoad  : true,
        model     : 'MyApp.model.InvoiceLookup_Model',
        proxy     : {
            type : 'jsonp',
            url  : 'data/php.php'
        },
        listeners : {
            load : function() {
                console.log(arguments);
            }
        }
    });
    and exactly this response (actual JSONP not JSON)

    Code:
    Ext.data.JsonP.callback1({"invoiceId" : null, "invoiceTotal" : null, "invoiceNumber" : null, "invoiceStatus" : null, "transactionDate" : null});
    I do not get any errors in 2.0.1.1, 2.1.0 RC1
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User andy370's Avatar
    Join Date
    Jul 2012
    Posts
    13
    Answers
    2
    Vote Rating
    1
    andy370 is on a distinguished road

      0  

    Default


    Sorry, I didn't show you my actual response:
    Code:
    Ext.data.JsonP.callback11({"invoiceId":null,"invoiceTotal":null,"invoiceNumber":null,"invoiceStatus":null,"transactionDate":null});
    On a hunch I changed:
    Code:
    <script src="../sencha-touch-2.1.0-b1/sencha-touch-all-debug.js"></script>
    To:
    Code:
    <script src="../sencha-touch-2.1.0-b1/sencha-touch-all.js"></script>
    In my index.html and *tada*, it's working. So apparently debug has a bug in it.

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."