skuid model save returns 'done' promise despite missing required field warning

Matt Sones
Matt Sones 💎💎💎
edited December 7, 2016 in Questions
Hello Skuid!

I am calling in a snippet like so:
'saveAllSnippet': function () {
var modelsToSave = [],
modelsToExclude = ['AddTests','ProcessLog','ChangeTracker','ShowTabs','UI_Model','DefaultTo','ChartAudit'],
dfd = new $.Deferred(); $.each(, function(){
if (this.hasChanged && (modelsToExclude.indexOf( === -1) && this.preventUnloadIfUnsavedChanges) { modelsToSave.push(this); }
}); $.when(
console.log('All Models Saved.'); dfd.resolve(); })
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.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!