mercredi 29 octobre 2014

How to get the .message from a model.save() from the server?

I'd like to do something like this but for a model.save() rather than a store.sync() in Ext JS 5. I tried adding an exception listener to the proxy via Sencha Architect 3.1 but this is broken at the moment. Is there a way to craft a callback to the .save() such that I can get access to the .success, .message and .total properties from the server's response?

I've tried this but I only seem to be able to get access to the success, and after console.logging() the other two parameters, I can't see the .message anywhere:



Code:



this.getViewModel().data.theClient.save({
callback: function(record, operation, success) {
if (success === false) {
record.reject();
}
}
});

Thanks.



How to get the .message from a model.save() from the server?

Aucun commentaire:

Enregistrer un commentaire