title: How to apply DataTable filter programmatically?
body: <p>Using the PrimeFaces Demo filtering <a href="https://www.primefaces.org/showcase/ui/data/datatable/filter.xhtml" rel="nofollow noreferrer">DataTable</a> (<a href="https://www.primefaces.org/showcase/ui/data/datatable/filter.xhtml" rel="nofollow noreferrer">https://www.primefaces.org/showcase/ui/data/datatable/filter.xhtml</a>) as an example, I would like to be able to provide "filtering" links outside of the table for the user to click (say Volvo, Forw, BMW, etc). When the user clicks the link, I would like to switch the selected item in the manufacturer filter dropdown and apply the filter. I haven't been able to figure out how to get to the filter properties to make the change. Can this be done via javascript? How do I access the selection list and set the current selection?</p>
  
  <p><strong>UPDATE:</strong><br/>
  Following Daniel's link, I managed to get the dropdown selection to change, but I am unable to get the filter to apply. In the columns where the filters are based on an input field, triggering the keyup causes the data to filter but I can't figure out what event to trigger on the select to make it filter. Here is the code I am using:</p>
  
  <pre><code>&lt;p:commandLink id="filterLink" 
      value="Click to filter to Volvo Only" 
      onclick="$('#carForm\\:dataTable\\:manufacturerColumn_filter').val('Volvo'),
          $('#carForm\\:dataTable\\:manufacturerColumn_filter').trigger('filter')"
  /&gt;
  </code></pre>
  
  <p>The link created by the above will switch the Manufacturer filter to Volvo but will not cause the data to filter.</p>