title: Angular UI-Grid: filtering cross-column or cross-row
body: <p>I'm still learning about Angular/ui-grid and have gotten stuck and hoping someone can point me in the right direction.  When you set up your grid you can turn on filtering with: </p>
  
  <pre><code>$scope.gridOptions.enableFiltering = true;
  </code></pre>
  
  <p>Then in the <em>columnDefs</em> when you define your grid you can turn on column filtering with various tests (equal to, contains, exact, less than, etc. ) or make up your own - i.e.  you can even define your own boolean function to drive the pass/fail of each row for your desired filtering logic. Here's a typical example:</p>
  
  <pre><code>{
     field: 'phone',
     filter: {
       condition: function(searchTerm, cellValue) {
         var strippedValue = (cellValue + '').replace(/[^\d]/g, '');
         return strippedValue.indexOf(searchTerm) &gt;= 0;
       }
  },
  </code></pre>
  
  <p>But this filtering logic ability all seems to be specific to one column. So what if you have a filtering test that is cross-field (simple example: does field A = field B?) or possibly even cross-row (i.e. I actually have a case where I do complex test across <strong>sets</strong> of rows to determine which rows should be filtered in/out). <strong>Is there a standard method for how to do this sort of more global filtering?</strong>  </p>
  
  <p>I've gotten close to a solution by saving the include/exclude results of the calculation in a hidden column that is not actually displayed, but I cannot seem to get ui-grid to actually execute the filter function on the hidden column.  This raises a related question:  <strong>how can you force the execution of a filtering operation (because I would like to trigger from a control that is not part of the grid)?</strong>  </p>
  
  <p>I tried to put together a plunkr of the simpler case (does A = B ?):  <a href="http://plnkr.co/edit/a0BJZVOGGIyP4Q4hxVob?p=preview" rel="nofollow">http://plnkr.co/edit/a0BJZVOGGIyP4Q4hxVob?p=preview</a></p>
  
  <p>I think if I understood how to make that work, perhaps the answer would also answer (or make moot) the dynamic aspect (how to force the filter operation when needed) of the problem as well.  </p>
  
  <p>Thanks for any assistance</p>