"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

@@ -98,6 +98,7 @@ export class NewJumpComponent implements OnInit {
private getListOfJumpTypes() {
this.serviceJumpType.getListOfJumpTypes().subscribe((data) => {
data.sort((a, b) => a.name.localeCompare(b.name));
this.listOfJumpType = data;
this.countDatasLoaded = 1;
@@ -109,6 +110,7 @@ export class NewJumpComponent implements OnInit {
private getListOfAircrafts() {
this.serviceAircraft.getListOfAircrafts(true).subscribe((data) => {
data.sort((a, b) => a.name.localeCompare(b.name));
this.listOfAircraft = data;
this.countDatasLoaded++;
});
@@ -116,7 +118,7 @@ export class NewJumpComponent implements OnInit {
private getListOfDropZones() {
this.serviceDropzone.getListOfDropZones(true).subscribe((data) => {
data.sort((a, b) => (b.isFavorite ? 1 : 0) - (a.isFavorite ? 1 : 0));
data.sort((a, b) => (b.isFavorite ? 1 : 0) - (a.isFavorite ? 1 : 0) || a.name.localeCompare(b.name));
this.listOfDropZone = data;
this.listOfFilteredDropZone = data;
this.countDatasLoaded++;
@@ -125,6 +127,7 @@ export class NewJumpComponent implements OnInit {
private getListOfGears() {
this.serviceGear.getListOfGears().subscribe((data) => {
data.sort((a, b) => b.id - a.id);
this.listOfGear = data;
this.countDatasLoaded++;
});