Reputation: 864
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>
Upvotes: 4
Views: 3415
Reputation: 50623
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'
Upvotes: 2