0

For PrimeNG Turbo Table, can you make sort only trigger when the sort icons are clicked?

Right now, it triggers whenever I click anywhere int he header cell. I'd like to just trigger when clicking the icons.

I was thinking this may be possible with StopPropogation() somewhere at the icon level...but that may stop the whole sort

https://www.primefaces.org/primeng/#/table/sort

user749798
  • 5,210
  • 10
  • 51
  • 85

1 Answers1

4

You can move pSortableColumn directive into <p-sortIcon ...>

<th>Year
<p-sortIcon [pSortableColumn]="'year'" [field]="'year'"></p-sortIcon>
</th>

Demo here

phucnh
  • 1,020
  • 6
  • 14