PDA

View Full Version : Does Model.destroy() have a failure callback?



simonr25
4 Jan 2012, 5:33 AM
Hello,
If a record/model instance is destroyed, I require to
retrieve a message in the response informing of the
reason for the error.


The code I use is below which doesn't allow me access
to the response.
rec.destroy({
success: function(){},
failure: function(){}
});


Have also an example of save() where I do have access
to the response.


rec.save({
success: function(){},
failure: function(alwaysNULL, operation){}
});


kind regards

mitchellsimoens
4 Jan 2012, 7:43 AM
If not there should be a callback callback