1. #1
    Sencha User mysticav's Avatar
    Join Date
    Mar 2007
    Location
    Mexico
    Posts
    478
    Vote Rating
    5
    mysticav is on a distinguished road

      0  

    Default Problem with proxy ajax call

    Problem with proxy ajax call


    The server is sending this:

    Code:
    {"data":[{paymentFormID:"1"}],"total":"1","validation":null,"isResult":true,"id":0,"isValid":null,"messages":null}
    But the store is firing loadexception event. What Can I do to find the problem ? Can somebody tell what do I have to check ? Is the problem caused by the JsonReader ?
    Using Ext with cachefly
    Working on LAMPExt

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,508
    Vote Rating
    58
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    So, why is it fireing loadexception? Hre's teh code

    Code:
        loadResponse : function(o, success, response){
            delete this.activeRequest;
            if(!success){
                this.fireEvent("loadexception", this, o, response);
                o.request.callback.call(o.request.scope, null, o.request.arg, false);
                return;
            }
            var result;
            try {
                result = o.reader.read(response);
            }catch(e){
                this.fireEvent("loadexception", this, o, response, e);
                o.request.callback.call(o.request.scope, null, o.request.arg, false);
                return;
            }
            this.fireEvent("load", this, o, o.request.arg);
            o.request.callback.call(o.request.scope, result, o.request.arg, true);
        },
    So it's either an Ajax failure, or a javascript exception.

    If there is a javascript exception it passes it. You can break in the handler, and examine the 4th param. Console.log it, and it will contain a full traceback.

  3. #3
    Sencha User mysticav's Avatar
    Join Date
    Mar 2007
    Location
    Mexico
    Posts
    478
    Vote Rating
    5
    mysticav is on a distinguished road

      0  

    Default


    The error occurs here:
    Line 11580: ext-all-debug
    Code:
    values[f.name] = f.convert((v !== undefined) ? v : f.defaultValue, n);
    The exception:
    "TypeError: f.convert is not a function"
    Using Ext with cachefly
    Working on LAMPExt

  4. #4
    Sencha User mysticav's Avatar
    Join Date
    Mar 2007
    Location
    Mexico
    Posts
    478
    Vote Rating
    5
    mysticav is on a distinguished road

      0  

    Default


    Ok. Found the problem, I wrong data type definition in JsonReader
    Using Ext with cachefly
    Working on LAMPExt

  5. #5
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    96
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    You specified an invalid type for one of the fields in your record.

  6. #6
    Sencha User mysticav's Avatar
    Join Date
    Mar 2007
    Location
    Mexico
    Posts
    478
    Vote Rating
    5
    mysticav is on a distinguished road

      0  

    Default


    Exactly. Thanks for your help. I didn't know about the 4th parameter, e. Very helpful
    Using Ext with cachefly
    Working on LAMPExt

Thread Participants: 2