2

I am trying to sort the auto-increment template column in primeng but it doesn't work without having to specify the [field] (I'm not sure what should field be assigned to incase of rowIndex)

<p-column header="#" [sortable]="true">
    <template let-index="rowIndex" pTemplate="body">
        <span>{{index+1}}</span>
    </template>
</p-column>

This displays the auto-increment based on the column index but doesn't sort the column.

Ali Baig
  • 3,819
  • 4
  • 34
  • 47

0 Answers0