Hello Skuid!
I am calling skuid.model.save() in a snippet like so:
'saveAllSnippet': function () {
var modelsToSave = [],
modelsToExclude = ['AddTests','ProcessLog','ChangeTracker','ShowTabs','UI\_Model','DefaultTo','ChartAudit'],
dfd = new $.Deferred(); $.each(skuid.model.map(), function(){
if (this.hasChanged && (modelsToExclude.indexOf(this.id) === -1) && this.preventUnloadIfUnsavedChanges) { modelsToSave.push(this); }
}); $.when(skuid.model.save(modelsToSave))
.done(function(){
console.log('All Models Saved.'); dfd.resolve(); })
.fail(function(){
console.log('All Model Save Failed.'); dfd.reject(); });
return dfd.promise();
}
As you can see from the image below, the .done() response is being called from $.when() despite the fact that the model is throwing a missing required field error.
Help?