OnChange event to PInputText in DataTable

Post Reply
China Steel
Posts: 5
Joined: 19 Aug 2017, 09:06

27 Dec 2017, 13:58

I want to implement pTemplate="filter" for text box, Below is my code which is not working as expected.

<p-column field="title" header="Title" sortable="true"
[filter]="true" filterMatchMode="contains">
<ng-template pTemplate="filter" let-title>
<input type="text" pInputText [(ngModel)]="titleFilter"
(onChange)="dt.filter($event.value, title.field, title.filterMatchMode)" styleClass="ui-column-filter"/>
</ng-template>

<ng-template let-issue="rowData" pTemplate="body">
<div>
{{issue.title}}
</div>
</ng-template>
</p-column>

According to PInputText document, OnChange event is not supported, but for filter in DataTable we must have OnChange event on element.
How can i achieve this?

merve7
Posts: 184
Joined: 12 Sep 2017, 10:44

04 Jan 2018, 09:20

Can you create a plunker example (http://plnkr.co/edit/6q5v84DWolH6DeAdi70w?p=preview)?

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest