validationMixin

validationMixin

Source:

Contains the methods that are mixed in on the model when binding

Methods

(static) isValid()

Source:

Check to see if an attribute, an array of attributes or the
entire model is valid. Passing true will force a validation
of the model.

(static) preValidate(attr, valueopt) → {undefined|string|Object}

Source:

Check whether an attribute or a set of attributes are valid. It will default to use the model's current values but
you can pass in different values to use in the validation process instead.

Parameters:
Name Type Attributes Description
attr string | Object | Array.<string>

Either the name of the attribute, an array containing many attribute names, or
on object with attribute name to values

value Any <optional>

a value to use for the attribute value instead of using the model's value.

Returns:

undefined if no errors, a validation exception if a single attribute, or an object with attribute name as key
and the error as the value

Type
undefined | string | Object

(static) validate()

Source:

This is called by Backbone when it needs to perform validation.
You can call it manually without any parameters to validate the
entire model.