Say I'm having a plain Backbone.Collection
with some models in it:
var Library = Backbone.Collection.extend({
model: Book
});
lib = new Library(
[Book1, Book2, Book3, Book4, Book5, Book6]
]);
How can I move a model within a collection - e.g. the 5th one to the 2nd position? So no sorting by a model field but just changing the sort order manually.
Note: I simplified the models Book1, ...
. They are of course Backbone.Model
s.