-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow an option to configure validation only for the model's changed attributes #202
base: master
Are you sure you want to change the base?
Conversation
When we are planning to incorporating this fix. I need this fix ASAP |
I think the owner lost interest in Backbone Validation. It's not very likely to get merged any time soon. |
Recently was added the ability to configure what attributes to be validated. Backbone.Validation.bind(this, {
attributes: function(view) {
return _.keys(view.model.changed);
}
}); |
Remember guys, to get what @blikblum recommended, please update the version of your Backbone.Validation. |
Hey blikbum, This will not work as i have to validate only one attribute on tab out and all attributes on save. |
Are you calling |
Yes On Wed, Jan 28, 2015 at 6:00 PM, Luiz Américo [email protected]
jitendra shah |
Sorry i was not clear, are you calling model.validate or model.set({validate:true})? |
model.set({validate:true}) On Thu, Jan 29, 2015 at 12:33 AM, Luiz Américo [email protected]
jitendra shah |
I could not reproduce the problem here.
You can check here that only changed attr get the error message: http://jsfiddle.net/thedersen/c3kK2/ |
ValidateAll flag is not present in the version 0.1.0.
|
|
When validating a form on a field:blur currently triggers validation of all invalid properties in the model, and these show up as messages all over the form.
Setting
useChangedAttr
forces the validation to be triggered only for the changed attributes. This request is based on work done in https://github.com/jeroensen/backbone.validation