Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PrimeNG DataTable Filtering filterMatchType not default

I am trying to get a data column to filter based on a "contains" match type, but it doesn't seem to work right for me. Anyone have any ideas?

Here is a Plunker, try filtering by "f70":

<p-dataTable [value]="orderList">
    <p-column field="itemDesc" header="Item"  filter="true" filterMatchMode="contains" filterPlaceholder="Contains" sortable="custom" (sortFunction)="onItemSort($event)">
      <template let-col let-row="rowData" pTemplate="body">
        <a [href]="'/e/fm/fm2/item/home.cfm?item_id=' + row['itemId']" target="_blank">{{row['itemNo']}} - {{row['itemDesc']}}</a>
      </template>
    </p-column>
</p-dataTable>
like image 377
BillF Avatar asked Sep 19 '25 19:09

BillF


1 Answers

You are having this problem because you are using old version of PrimeNG where filtering had a lot of bugs, to be more precise, version 1.1.2, which can be seen on line 54 of systemjs.config.js file in your Plunker:

'primeng': 'npm:[email protected]/primeng.js'

If you use latest version (2.0.3), your filter with filterMatchMode="contains" will work like a charm. So, just change version in your system.config.js file:

'primeng': 'npm:[email protected]/primeng.js'
like image 87
Stefan Svrkota Avatar answered Sep 21 '25 10:09

Stefan Svrkota