It is redundant as it can easily be done with
It is NOT redundant. Row selection is NOT the same as generic "click" event. A row selection is supposed to send you back the model (the content of the row). Click sends you back a MouseEvent.
@wz2b You can bind click event on tr element in table.
<p-table [columns]="cols" [value]="cars">
<ng-template pTemplate="header" let-columns>
<tr>
<th *ngFor="let col of columns">
{{col.header}}
</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-rowData let-columns="columns">
<tr (click)="onRowClick($event, rowData)"> <!-- like this -->
<td *ngFor="let col of columns">
{{rowData[col.field]}}
</td>
</tr>
</ng-template>
</p-table>
Most helpful comment
@wz2b You can bind click event on
trelement in table.