Results 1 to 6 of 6

Thread: Problem with proxy ajax call

  1. #1
    Sencha User mysticav's Avatar
    Join Date
    Mar 2007
    Location
    Mexico
    Posts
    528
    Vote Rating
    50
      0  

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

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,607
    Vote Rating
    59
      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
    528
    Vote Rating
    50
      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"

  4. #4
    Sencha User mysticav's Avatar
    Join Date
    Mar 2007
    Location
    Mexico
    Posts
    528
    Vote Rating
    50
      0  

    Default

    Ok. Found the problem, I wrong data type definition in JsonReader

  5. #5
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    118
      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
    528
    Vote Rating
    50
      0  

    Default

    Exactly. Thanks for your help. I didn't know about the 4th parameter, e. Very helpful

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •