We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When binding collections to Backbone.Validation may be difficult to identify which of the models is invalid. I end up doing something like this:
Backbone.Validation.bind(this, { valid: this._onValid.bind(this), invalid: this._onInvalid.bind(this), collection: this.collection });
_onInvalid: function(view, attr, error){ <-- add model here var $form = this._getCapacitiesForm(); $form .find('tr[data-id="' + this.checkedModel.get('id') + '"]') .find('[data-validation~="' + attr + '"]') .addClass('has-error') .find('.help-block') .removeClass('hidden') .text(error); },
this.collection.each(function(model){ this.checkedModel = model; <-- this if (model.isValid(true)) { return; } }, this);
It would be nice to have the model available as argument for valid and invalid callbacks.
valid
invalid
Thanks
The text was updated successfully, but these errors were encountered:
This is fixed in a fork i'm maintaining (tried contact this repository admins without luck): https://github.com/blikblum/backbone.validation
The updated package can be found at https://www.npmjs.com/package/backbone.validation
To use with node: npm install backbone.validation
Sorry, something went wrong.
No branches or pull requests
When binding collections to Backbone.Validation may be difficult to identify which of the models is invalid. I end up doing something like this:
It would be nice to have the model available as argument for
valid
andinvalid
callbacks.Thanks
The text was updated successfully, but these errors were encountered: