Results 1 to 4 of 4

Thread: How retrieve response following a Model save() call

  1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    23

    Question How retrieve response following a Model save() call

    Hello,
    I am using Ajax Json Data writer.
    I require to retrieve the response following a model/record save() call.
    The callback - success function - doesn't seem to have
    arguments containing the response.
    Can/How can this be done?
    Thank you in advance,
    bryan

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    Take a look at the 2nd argument:

    Code:
    rec.save({
        success: function(rec, e) {
            console.log(e.response);
        }
    });
    Just like success, there is failure and callback. callback will fire regardless of succes/failure.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Posts
    15

    Default Not function read error

    Hi,

    My rest service sent : Response.status(200).entity("true").build();

    and in case of error: Response.status(400).entity("Error Error Error").build();

    But the client Extjs can't read it. Why ?? Is there a soluction ?


    I'd like to read the custom error sent to server.

    So I wrote:

    failure: function(record, operation)
    {
    console.log(operation.response);

    Ext.Msg.show({
    //title: 'Error',
    msg: operation.error,
    buttons: Ext.Msg.OK,
    icon: Ext.Msg.ERROR
    });

    }


    But the log send undefined.

  4. #4
    Sencha User
    Join Date
    Sep 2011
    Location
    Taiwan
    Posts
    106
    Answers
    1

    Default

    I have the same question as popiero70. Can anyone help?

Posting Permissions

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