I am trying to implement datatable of primeng. In which, I have created an array of header, field and options, i.e.: headersList.
It is as shown below:
{
header: "Time",
field: "time",
options: "timeOptions"
}, {
header: "Date",
field: "date",
options: "dateOptions"
}, {
header: "Table No.",
field: "table_no",
options: "tableOptions"
}
I am passing this array to 'p-column' like this:
<p-column *ngFor="let head of headersList" [field]="head.field" [header]="head.header" [filter]="true" filterPlaceholder="search" filterMatchMode="in">
<ng-template pTemplate="filter" let-col>
<p-multiSelect [options]="head.options" defaultLabel="Search" (onChange)="dt.filter($event.value,col.field,col.filterMatchMode)"></p-multiSelect>
</ng-template>
</p-column>
But it's not working. I need to add options field of headersList to options of p-multiselect