What would be a good way to add two levels of row expansion with the primeng turbo table extension?
I've tried thinking through how to do this, as it does not seem to come out of the box.
There is only one rowexpansion template to the row group below. I would like it to look like the first option on the site (here), but also have another toggle row beneath the data (two levels)
<h3 class="first">Toggleable Row Groups</h3>
<p-table [value]="cars" dataKey="brand">
<ng-template pTemplate="header">
<tr>
<th>Vin</th>
<th>Year</th>
<th>Color</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-rowData let-rowIndex="rowIndex" let-expanded="expanded" let-columns="columns">
<tr class="ui-widget-header" *ngIf="rowGroupMetadata[rowData.brand].index === rowIndex">
<td colspan="3">
<a href="#" [pRowToggler]="rowData">
<i [ngClass]="expanded ? 'fa fa-fw fa-chevron-circle-down' : 'fa fa-fw fa-chevron-circle-right'"></i>
<span>{{rowData.brand}}</span>
</a>
</td>
</tr>
</ng-template>
<ng-template pTemplate="rowexpansion" let-rowData let-rowIndex="rowIndex">
<tr>
<td>{{rowData.vin}}</td>
<td>{{rowData.year}}</td>
<td>{{rowData.color}}</td>
</tr>
</ng-template>
<!-- Is it possible to add another row expansion here? -->
</p-table>
pTemplate=body
template and add as many rowexpansions as you like. I did that in some project a year ago and it worked fine :) – Define<tr>
add<ng-container *ngTemplateOutlet="yourOwnRowExtentionTemplate; context: rowData"></ng-container>
with a proper ngIf directive. This way you can nest them however you want. – Define