title: How to preset (programmatically) the filter value in primeng datatable
body: <p>Using angular (4.1.3) and primeng (4.0.3) datatable I need to set the filter value (e.g. from URL parameter).</p>
  
  <p>There is a pretty good docu on custom filters by primeng (<a href="https://www.primefaces.org/primeng/#/datatable/filter" rel="nofollow noreferrer">https://www.primefaces.org/primeng/#/datatable/filter</a>). 
  I've tried to implement it similarly with a primeng InputText component as a custom filter:</p>
  
  <pre><code>&lt;p-dataTable 
        [value]="licenses" scrollable="true"
        exportFilename="licenses" 
        sscrollHeight="60vh" [paginator]="true" [rows]="20"  [pageLinks]="10" [rowsPerPageOptions]="[5,10,20,50,100,999999]" #dt&gt;
  
          &lt;p-column [style]="{'width':'180px'}" [sortable]="true" field="customerId" header="Customer ID" [filter]="true" filterMatchMode="contains" filterPlaceholder="Search"&gt;
  
            &lt;ng-template pTemplate="filter" let-col&gt;
              &lt;input type="text" pInputText [(ngModel)]="custFilter" style="width:100%" (onChange)="dt.filter($event.value,col.field,col.filterMatchMode)" class="ui-column-filter"/&gt;
            &lt;/ng-template&gt;
  
          &lt;/p-column&gt;
  
          ...
  
  &lt;/p-dataTable&gt;
  </code></pre>
  
  <p>Now I have an input field, which looks like the "regular" one and even has a "custFilter" model from my component as pre-selected filter value. </p>
  
  <p>The only issue is, this custom filter does not work. It just does not filter regardless of which value I enter (in opposite to the "regular" primeng datatable filter). 
  <a href="https://i.stack.imgur.com/RzEGm.png" rel="nofollow noreferrer">Here is a screenshot</a></p>