PDA

View Full Version : I can not get server response from model save with rest proxy



mboreback
5 Aug 2012, 12:24 AM
I am moving from Ajax call to model and res proxy.
When I save I need the server resposnseText, but I can not seem to get this information.
In below code in the success method I like to process server response and update the curent record and add this to the store.

Proxy is tied to the model in my case.

var store = Ext.getStore('MyStore');
record.save({
success : function(f, action) {// Optional function
if (null === store.findRecord('cid', record.data.cid)) {
// get id from action and update record before adding it to store


store.add(record);
}
},
failure : function(f, action) {
console.log(f,action);
var a = action.getResultSet();
console.log(a);
Ext.Msg.alert("Failed",action.request.scope.reader.jsonData.message);
record.reject();
return;
},
scope : this
});