Skip to content

Instantly share code, notes, and snippets.

@AhmedHamedTN
Last active May 14, 2018 15:44
Show Gist options
  • Save AhmedHamedTN/378a2b23a57c70be196b7ca0cd0c713f to your computer and use it in GitHub Desktop.
Save AhmedHamedTN/378a2b23a57c70be196b7ca0cd0c713f to your computer and use it in GitHub Desktop.
PrimeNG p-dropdown with options as filter example inside p-datatable (make it work)
<p-dataTable [value]="cars" [rows]="10" [paginator]="true" [globalFilter]="gb" #dt>
<p-header>List of Cars</p-header>
<p-column field="vin" header="Vin (startsWith)" [filter]="true" filterPlaceholder="Search"></p-column>
<p-column field="brand" header="Brand (Custom)" [filter]="true" filterMatchMode="equals">
<ng-template pTemplate="filter" let-col>
<p-dropdown [options]="brands" appendTo="body" [style]="{'width':'100%'}" (onChange)="dt.filter($event.value,col.field,col.filterMatchMode)" styleClass="ui-column-filter"></p-dropdown>
</ng-template>
</p-column>
</p-dataTable>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment