Skip to content
This repository has been archived by the owner on Jul 10, 2018. It is now read-only.

Commit

Permalink
Fixes jashkenas#689, documenting the need to resort collections with …
Browse files Browse the repository at this point in the history
…comparators.
  • Loading branch information
jashkenas committed Oct 29, 2011
1 parent 32ae113 commit d94cfe5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions index.html
Expand Up @@ -1275,6 +1275,12 @@ <h2 id="Collection">Backbone.Collection</h2>
"sort", which must return <tt>0</tt>, <tt>1</tt>, or <tt>-1</tt>,
and is more similar to a <tt>sortBy</tt> &mdash; a much nicer API.
</p>

<p class="warning">
Collections with comparator functions will not automatically re-sort if you
later change model attributes, so you may wish to call <tt>sort</tt> after
changing model attributes that would affect the order.
</p>

<p id="Collection-sort">
<b class="header">sort</b><code>collection.sort([options])</code>
Expand Down

0 comments on commit d94cfe5

Please sign in to comment.