You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that the nested models are not being "committed" from the List modal. This means that if the schema does not contain validation but the model does, the nested modal will be saved to the main model even though it is not valid (on the model).
Seems like an easy enough fix, we just force the embedded model to commit. Near line 392 in jquery-ui-editors:
var saveAndClose = function() {
var errs = editor.validate();
if (errs) return;
//validate against the model too
if(listType == "NestedModel"){
errs = editor.commit();
if (errs) return;
}
However, the NestedModel editor has this line in its commit function near line 1500 in backbone-forms.js. This will kick an error from the modal.
I'm almost done writing a completely revamped List editor so any further development will go into that, but if you can create a fix and a pull request I'll merge that. The List editor itself isn't properly tested at the moment but as long as all the other tests are passing it should be good to do.
You can run the tests by opening test/index.html in a browser. Let me know if you have any more questions, thanks
It seems that the nested models are not being "committed" from the List modal. This means that if the schema does not contain validation but the model does, the nested modal will be saved to the main model even though it is not valid (on the model).
Seems like an easy enough fix, we just force the embedded model to commit. Near line 392 in jquery-ui-editors:
var saveAndClose = function() {
var errs = editor.validate();
if (errs) return;
However, the NestedModel editor has this line in its commit function near line 1500 in backbone-forms.js. This will kick an error from the modal.
return editors.Object.prototype.commit.call(this);
Any ideas on how to insure the List jquery-ui-editor for NestedModels will validate against the model?
The text was updated successfully, but these errors were encountered: