I am using a turbotable where first column is checkbox selection. I need to show the checked rows on top of the table.
How do I achieve that?
I am using a turbotable where first column is checkbox selection. I need to show the checked rows on top of the table.
How do I achieve that?
You need to use pTemplate = caption and show details inside that:
<p-table #dt [columns]="cols" [value]="cars" [paginator]="true" [rows]="10">
<ng-template pTemplate="caption">
<div style="text-align: right">
<ul>
<li *ngFor="let car of selectedCars2" style="text-align: left">
{{car.vin + ' - ' + car.brand + ' - ' + car.year + ' - ' + car.color}}
</li>
</ul>
</div>
</ng-template>
<ng-template pTemplate="header" let-columns>
...
</ng-template>
primeNG documentation https://www.primefaces.org/primeng/#/table/selection
they have an example for that, showing the selected rows at the bottom of the table,
all you have to do is changing the position.