mirror of
https://github.com/jashkenas/backbone.git
synced 2026-04-30 03:00:06 -04:00
documenting validationError
This commit is contained in:
@@ -252,6 +252,9 @@
|
||||
// A hash of attributes whose current and previous value differ.
|
||||
changed: null,
|
||||
|
||||
// The value returned during the last failed validation.
|
||||
validationError: null,
|
||||
|
||||
// The default name for the JSON `id` attribute is `"id"`. MongoDB and
|
||||
// CouchDB users may want to set this to `"_id"`.
|
||||
idAttribute: 'id',
|
||||
|
||||
11
index.html
11
index.html
@@ -334,6 +334,7 @@
|
||||
<li>– <a href="#Model-save">save</a></li>
|
||||
<li>– <a href="#Model-destroy">destroy</a></li>
|
||||
<li>– <a href="#Model-validate">validate</a></li>
|
||||
<li>– <a href="#Model-validationError">validationError</a></li>
|
||||
<li>– <a href="#Model-url">url</a></li>
|
||||
<li>– <a href="#Model-urlRoot">urlRoot</a></li>
|
||||
<li>– <a href="#Model-parse">parse</a></li>
|
||||
@@ -1283,7 +1284,9 @@ book.destroy({success: function(model, response) {
|
||||
error object that describes the error programmatically. If <b>validate</b>
|
||||
returns an error, <tt>set</tt> and <tt>save</tt> will not continue, and the
|
||||
model attributes will not be modified.
|
||||
Failed validations trigger an <tt>"invalid"</tt> event.
|
||||
Failed validations trigger an <tt>"invalid"</tt> event, and set the
|
||||
<tt>validationError</tt> property on the model with the value returned by
|
||||
this method.
|
||||
</p>
|
||||
|
||||
<pre class="runnable">
|
||||
@@ -1314,6 +1317,12 @@ one.save({
|
||||
messages at the model or collection level.
|
||||
</p>
|
||||
|
||||
<p id="Model-validationError">
|
||||
<b class="header">validationError</b><code>model.validationError</code>
|
||||
<br />
|
||||
The value returned by <a href="#Model-validate">validate</a> during the last failed validation.
|
||||
</p>
|
||||
|
||||
<p id="Model-url">
|
||||
<b class="header">url</b><code>model.url()</code>
|
||||
<br />
|
||||
|
||||
Reference in New Issue
Block a user