View Full Version : How retrieve response following a Model save() call
bryan10
6 Jan 2012, 12:27 AM
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
mitchellsimoens
6 Jan 2012, 1:05 PM
Take a look at the 2nd argument:
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.
popiero70
11 Oct 2012, 6:35 AM
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.
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.