2 ms·
Voila. collection.each(function(model) { model.set({visible: matchesSearch(model)}); }); And then, in your view: model.bind("change:visibl
by jashkenas 15y ago
Voila.
collection.each(function(model) {
model.set({visible: matchesSearch(model)});
});
And then, in your view:
model.bind("change:visible", function() {
$(this.el).toggle(model.get("visible"));
});
... assuming that you have a "matchesSearch" function that can tell you if a given model matches the current search term.