Skip to content

Commit 37c09c4

Browse files
committed
Restore total rows #11379
MatTable does not support adding a definition of footer after its initialization. So hiding total must never remove the element entirely, but instead we must use styling to hide the existing element.
1 parent 4e3c3e0 commit 37c09c4

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

client/app/admin/bookables/bookables/bookables.component.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@
2929
<table mat-table matSort [dataSource]="dataSource" (matSortChange)="sorting([$event])">
3030
<tr *matHeaderRowDef="columnsForTable" mat-header-row></tr>
3131
<tr *matRowDef="let row; columns: columnsForTable" mat-row></tr>
32-
@if (!route.snapshot.data.hideTableFooter) {
33-
<tr *matFooterRowDef="columnsForTable" mat-footer-row></tr>
34-
}
32+
<tr
33+
*matFooterRowDef="columnsForTable"
34+
mat-footer-row
35+
[hidden]="!dataSource.data?.length || route.snapshot.data.hideTableFooter"
36+
></tr>
3537

3638
<ng-container matColumnDef="image">
3739
<th *matHeaderCellDef mat-header-cell mat-sort-header class="natural-2em-column"></th>

client/app/admin/transactions/transactionLines/transactionLines.component.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@
2525
<table mat-table matSort [dataSource]="dataSource" (matSortChange)="sorting([$event])">
2626
<tr *matHeaderRowDef="columnsForTable" mat-header-row></tr>
2727
<tr *matRowDef="let row; columns: columnsForTable" mat-row></tr>
28-
@if (dataSource.data?.length && !relativeToAccount) {
29-
<tr *matFooterRowDef="columnsForTable" mat-footer-row></tr>
30-
}
28+
<tr
29+
*matFooterRowDef="columnsForTable"
30+
mat-footer-row
31+
[hidden]="!dataSource.data?.length || relativeToAccount"
32+
></tr>
3133

3234
<ng-container matColumnDef="name">
3335
<th *matHeaderCellDef mat-header-cell mat-sort-header>Nom</th>

0 commit comments

Comments
 (0)