2

I try to implement a datatable with dynamic column sortable and paginator.

My problem is that sorting doesn't work:

My code:

 <p-dataTable [value]="enregistrements" [row]="10" [paginator]="true"
 [pageLinks]="3" [rowPerPageOptions]="5,10(20]" scrollable="true" scrollWidth="1200px">
<ng-container *ngFor="let champ of champs; let i = index">
    <p-column header="{{champ}}" [sortable]="true" field="{{champ}}">
        <ng-template let-enregistrement="rowData" pTemplate type="body">{{enregistrement.champs[i].value}}</ng-template>
    <p-column>
</ng-container>
</p-dataTable>

Ideas on what the problem might be?

My code compile and the display is right but when i click on header column to sort it, nothing happens.

Antikhippe
  • 6,316
  • 2
  • 28
  • 43
mathieu lavergne
  • 591
  • 1
  • 6
  • 10

0 Answers0