Code: Select all
<p-tabView orientation="left" [activeIndex]="index">
<p-tabPanel [header]="property.name" *ngFor="let property of selectedProperties; let i = index" [selected]="i == 0">
<ng-template pTemplate="content">
<p-table #dt [columns]="cols" [value]="property?.pitches"
rowExpandMode="single"
(onRowExpand)="loadComments($event)" (onRowCollapse)="hideComments($event)" > <!-- loadComments makes a service call. -->
<ng-template pTemplate="header" let-columns>
<tr>
<th style="width: 3em"></th>
<th *ngFor="let col of columns" [pSortableColumn]="col.sort">
{{col.header}}
<p-sortIcon [field]="col.sort"></p-sortIcon>
</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-rowData let-columns="columns" let-expanded="expanded" >
<tr [pSelectableRow]="rowData">
<td>
<a href="#" [pRowToggler]="rowData">
<i [ngClass]="expanded ? 'pi pi-chevron-down' : 'pi pi-chevron-right'"></i>
</a>
</td>
<td *ngFor="let col of columns">
{{rowData[col.field] ? rowData[col.field][col.nested] : ''}}
</td>
</tr>
</ng-template>
<ng-template pTemplate="rowexpansion" let-rowData let-columns="columns">
<tr>
<td [attr.colspan]="columns.length + 1">
</td>
</tr>
</ng-template>
</p-table>
</div>
</div>
</ng-template>
</p-tabPanel>
</p-tabView>