Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: