I’m using the where method grab some specific models from a collection. Similar to the example from backbone site:
var friends = new Backbone.Collection([
{name: "Athos", job: "Musketeer"},
{name: "Porthos", job: "Musketeer"},
{name: "Aramis", job: "Guard"},
{name: "d'Artagnan", job: "Guard"},
]);
var musketeers = friends.where({job: "Musketeer"});
Which will return the 2 models that has the Musketeer job.
How do I put those 2 Musketeer models into a new collection and render a collectionView for it?
You can pass it to a new collection using
collection.reset. Then simply pass it to a view and render.http://jsfiddle.net/k3JEz/1/