0

I have a Data Table with two columns, each one having a filter input. Values are populating in rows as expected. The only problem lies with "director" filter. Fields are defined as:

this.moviecols = [
    { field: "name", header: 'NAME' },
    { field: "directorstatus", header: 'DIRECTOR STATUS' }
]

Response from Server:

{
    director: {name: null, status: "Pro"}
    name: "Star Wars"
}

I am able to filter movies with "name" column:

<input *ngIf="col.field != 'director'" pInputText type="text" (input)="table.filter($event.target.value, col.field, col.filterMatchMode)">

But for "director status" column, where I'm displaying the status field, following code is not working:

<input *ngIf="col.field == 'directorstatus'" pInputText type="text" (input)="table.filter($event.target.value, col.field['status'], col.filterMatchMode)">
rishav
  • 441
  • 9
  • 27
  • Map your json to have a flat list ? `directorName`, `directorStatus` ? I don't think you can pass a custom filter function to the turbotable.. – Jonathan Hamel Mar 11 '19 at 12:56
  • I'm quite new to Angular. Can you please provide code snippet on how to do that? – rishav Mar 11 '19 at 12:59

0 Answers0