Hacker News new | ask | show | jobs
by jashkenas 5362 days 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.