0

Dear all I am using the p-table component from primeNG library:

enter image description here

the main filter (highlighted input box) is working but when I click on the funnel next to the 'Sample' nothing happens and no error is showing in the console. I am expecting something similar to the following:

enter image description here

Here is my code:

<p-table #dt1 id="graphData" [value]="graphData" dataKey="sample" [rows]="6" [showCurrentPageReport]="true" [rowsPerPageOptions]="[6,10,25,50]" [loading]="loading" styleClass="p-datatable-gridlines" [paginator]="true" currentPageReportTemplate="Showing {first} to {last} of {totalRecords} entries"
                            [globalFilterFields]="['sample','tyre_pressure','speed','power']">
                            <ng-template pTemplate="caption">
                                <div class="flex">
                                    <button pButton label="Clear" class="p-button-outlined" icon="pi pi-filter-slash" (click)="clear(dt1)"></button>
                                    <span class="p-input-icon-left ml-auto">
                                        <i class="pi pi-search"></i>
                                        <input #filterName pInputText type="text"
                                            (input)="dt1.filterGlobal($event.target.value, 'contains')"
                                            placeholder="Search keyword" />
                                    </span>
                                </div>
                            </ng-template>
                            <ng-template pTemplate="header">
                                <tr>
                                    <th>
                                        <div class="flex justify-content-center align-items-center">
                                            Sample
                                            <p-columnFilter type="text" field="graphData.sample" display="menu">
                                            </p-columnFilter>
                                        </div>
                                    </th>
                                    <th>
                                        <div class="flex justify-content-center align-items-center">
                                            Tyre Pressure
                                            <p-columnFilter type="number" field="tyre_pressure" display="menu">
                                            </p-columnFilter>
                                        </div>
                                    </th>

The text filter in p-columFilter is not showing when I press the funnel button:

<th>
                                        <div class="flex justify-content-center align-items-center">
                                            Sample
                                            <p-columnFilter type="text" field="graphData.sample" display="menu">
                                            </p-columnFilter>
                                        </div>
                                    </th>

What am i missing?

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
Dino
  • 1,307
  • 2
  • 16
  • 47

1 Answers1

0

I have discovered that primeng V13 is not compatible with the latest version of angular cli. After downgrading to:

"primeflex": "^3.0.0",
"primeicons": "^4.1.0",
"primeng": "^12.2.2",

the filter buttons worked

Dino
  • 1,307
  • 2
  • 16
  • 47