Base solution for your next web application
Open Closed

row grouping with summary row #8485


User avatar
0
sophoana created

Hello support,

Row groups with summary rows does not exist in primeng table. How can i create a table using row grouping with summary row(total) in primeng table.

I am use Angular 7 with ASP.net Core

Thanks.


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    If you can find lastIndex of an item in rowGroup body, you can include another tr. What I mean is something like this;

    <ng-template pTemplate="body" let-rowData let-rowIndex="rowIndex">
    	<tr class="ui-widget-header" *ngIf="rowGroupMetadata[rowData.brand].index === rowIndex">
    		<td colspan="3">
    			<span style="font-weight:bold">{{rowData.brand}}</span>
    		</td>
    	</tr>
    	<tr>
    		<td>{{rowData.vin}}</td>
    		<td>{{rowData.year}}</td>
    		<td>{{rowData.color}}</td>
    	</tr>
    	<tr *ngIf="{LAST_ROW_CHECK_CONDITION}">
    		<td colspan="3">{{rowData.vin}}</td>
    	</tr>
    </ng-template>