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?
OnChange event to PInputText in DataTable
Forum rules
Please note that response time for technical support is within 3-5 business days.
Please note that response time for technical support is within 3-5 business days.
Can you create a plunker example (http://plnkr.co/edit/6q5v84DWolH6DeAdi70w?p=preview)?
You may want to look at this https://stackoverflow.com/questions/448 ... in-angular . I was able to solve the issue using
Code: Select all
// ngModelChange
// Something like this
<input type="text" [(ngModel)]="rowData.time" (ngModelChange)="onTimeChange(rowData)" [disabled]="rowData.disableTime">
-
- Information
-
Who is online
Users browsing this forum: No registered users and 10 guests