"Sort" sur les tableaux et listes déroulantes.

This commit is contained in:
Sébastien André
2021-04-22 14:29:22 +02:00
parent a2ea873ae3
commit 6f7b439e56
8 changed files with 19 additions and 13 deletions

View File

@@ -25,4 +25,8 @@ table {
flex-direction: column;
align-items: initial;
padding-top: 25px;
}
th.mat-header-cell {
text-align: center;
}

View File

@@ -5,7 +5,7 @@
<div *ngIf="dataSourceTable != null else loading">
<table mat-table [dataSource]="dataSourceTable">
<ng-container matColumnDef="infos">
<th mat-header-cell *matHeaderCellDef></th>
<th mat-header-cell *matHeaderCellDef style="width: 60px;"></th>
<td mat-cell *matCellDef="let element" style="text-align: left;">
<mat-icon aria-hidden="false" aria-label="Special jump" [style.visibility]="element.isSpecial ? 'visible' : 'hidden'">celebration</mat-icon>
<mat-icon aria-hidden="false" aria-label="Additional informations of the jump" style="cursor: pointer;"
@@ -14,7 +14,7 @@
</ng-container>
<ng-container matColumnDef="id">
<th mat-header-cell *matHeaderCellDef>ID</th>
<th mat-header-cell *matHeaderCellDef style="width: 60px;">Num</th>
<td mat-cell *matCellDef="let element">{{element.id}}</td>
</ng-container>
@@ -52,7 +52,7 @@
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef></th>
<th mat-header-cell *matHeaderCellDef style="width: 70px;"></th>
<td mat-cell *matCellDef="let element" style="text-align: left;">
<mat-icon aria-hidden="false" aria-label="Delete this jump" style="cursor: pointer;"
(click)='delete(element)'>delete</mat-icon>
@@ -65,7 +65,7 @@
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
</div>
<mat-paginator [length]="resultsLength" [pageSize]="10"></mat-paginator>
<mat-paginator [length]="resultsLength" [pageSize]="20"></mat-paginator>
<ng-template #loading>
<mat-progress-spinner [mode]="'indeterminate'"></mat-progress-spinner>

View File

@@ -49,7 +49,7 @@ export class ListOfJumpsComponent implements OnInit {
this.listOfJumps = this.serviceApi.GetListOfJumps();
this.listOfJumps.subscribe(data => {
setTimeout(() => {
data.sort((a, b) => b.jumpDate.getTime() - a.jumpDate.getTime());
data.sort((a, b) => b.id - a.id);
this.dataSourceTable = new MatTableDataSource<JumpResp>(data);
this.dataSourceTable.paginator = this.paginator;
this.resultsLength = data.length;