0
votes

I am using PrimeNG turbotable for creating a table in my angular app. I want to sort by selected column names. But I am using server-side sorting. So I just want to pass parameters like sort order and sort column. I researched a lot and found custom sort functionality on https://www.primefaces.org/primeng/#/table/sort. I am trying to embed that in my code but I am getting following error:

Error: Template parse errors: Can't bind to 'customSort' since it isn't a known property of 'p-table'.

I know the meaning of this error but turbotable has boolean customSort property listed on the official website.

code:

<p-table [columns]="cols" [value]="data"
[rows]="20" [totalRecords]="totalRecords" [responsive]="true" (sortFunction)="sortdata($event)" [customSort]="true">
<ng-template pTemplate="header" let-columns>
    <tr>
        <th *ngFor="let col of columns" [pSortableColumn]="col.field" >
            {{col.header}}
            <p-sortIcon [field]="col.field" ></p-sortIcon>
        </th>
    </tr>
</ng-template>
<ng-template pTemplate="body" let-rowData let-columns="columns">
    <tr>
        <td *ngFor="let col of columns">
            {{rowData[col.field]}}           
        </td>
    </tr>
</ng-template>
</p-table>

Any help would be appreciated.

1
Which version of PrimeNG are you using ?Antikhippe
@Antikhippe: 5.2.0-rc.1chinmaykelkar

1 Answers

0
votes

customSort property is not available in PrimeNG 5.2.0-rc.1. It's available from 5.2.0-rc.2 (l. 181).