title: Angular UI Grid - select all based on filter
body: <p>I am currently using ui-grid and have run into a small problem. I want to be able to <code>select all</code> the items based on filters I have set within the grid. For example, if I do a <code>select all</code> without a filter, 500 items will be selected. Then, if I filter a column and <code>select all</code>, 500 items are again selected instead of the items that are currently being shown. </p>
  
  <p>My select all logic is very simple per the ui-grid documentation:</p>
  
  <pre><code>$scope.selectAll = function () {
      $scope.gridApi.selection.selectAllRows();
  };
  
  $scope.clearAll = function () {
      $scope.gridApi.selection.clearSelectedRows();
  };
  </code></pre>
  
  <p>The reason I want this is because I'm working on a mass delete - the ability to filter down the grid to items you can then delete simply by clicking <code>select all</code> and then <code>delete</code>.</p>