title: Filtering records according to dropdownlist
body: <p>I need to filter the listing or records according to selection in dropdownlists.
  I have three dropdowns that needs to filter the records reactively in collaboration with each other. i.e value selection in one dropdownlist should filter the records effected by other dropdownlist values.</p>
  
  <pre><code>var filterAndLimitResults = function (cursor) {
  
      if (!cursor) {
          return [];
      }
  
      var raw = cursor.fetch();
  
      var currentChosenCategory = chosenCategory.get();
      var currentChosenCity = chosenCity.get();
      var currentJtype = chosenJtype.get();
  
      console.log(currentChosenCategory);
      console.log(currentChosenCity);
      // filter category
      var filtered = [];
      if (!currentChosenCategory || currentChosenCategory == "" &amp;&amp; !currentChosenCity || currentChosenCity == "" &amp;&amp; !currentJtype || currentJtype == "")
      {
          filtered = raw;
        //  console.log(filtered);
      }
      else {
  
          filtered = _.filter(raw, function (item) {
            if(currentChosenCategory){
              return item.ccategory === currentChosenCategory ;
            }
            if(currentChosenCity){
              return item.city === currentChosenCity ;
              console.log(item.city === currentChosenCity);
            }
          });
        }
  
  var currentLimit =limit.get();
  //enforce the limit
  if (currentLimit ) {
      filtered = _.first(filtered, currentLimit );
  }
  return filtered;
  };
  </code></pre>
  
  <p>the above code is doing both filtering the dropdowns and limit the number of records so as to give infinite scrolling.</p>
  
  <p><strong>Edit For Text Based Search</strong></p>
  
  <p>Here is my eventmap for seach box</p>
  
  <pre><code>"keyup #search-title":function(e,t){
       if(e.which === 27){
         searchTitle.set("");
       }
       else {
         var text = $(e.target.val);
         searchTitle.set(text)
         console.log(searchTitle.set(text));
       }
     }
  </code></pre>
  
  <p>This is what iam doing in the <code>filteredAndLimitResults</code></p>
  
  <pre><code>if(!(!currentSearchTitle || currentSearchTitle == "")) {
        filtered = _.filter(filtered, function (item) {
                return item.title === currentSearchTitle ;
                console.log(item.title === currentSearchTitle);
        });
      }
  </code></pre>
  
  <p>when i am typing something in the search box. all the records vanishes and when in press <code>esc</code> it comes back to as it was. in <code>console.log</code> i can see that on everytime i press a key it returns the collection.</p>