Backbone.js validation broken (0.9.9 vs. 0.9.10) -
backbone changed few things validation between these versions, first off, have explicitly pass {validation: true} set call validation trigger. there must have been change too, because doesn't work no longer.
model.set(obj, { error : function(model, error){ //do stuff error } })
i found ticket on backbone's github, answers issue if using save, not set.
here's solution i've discovered.
1) assign set variable called success (or whatever like)
var success = model.set(obj, {validate : true});
2) check status of success, , use model.validationerror
if(!success){ var error = model.validationerror; // stuff error }
Comments
Post a Comment