Ajout de la possibilité de supprimer un saut
Ajout de la possibilité de ne pas reset le formulaire après ajout de sauts
This commit is contained in:
@@ -50,6 +50,14 @@
|
||||
<td mat-cell *matCellDef="let element">{{element.gear.name}}</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="actions">
|
||||
<th mat-header-cell *matHeaderCellDef></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>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
||||
</table>
|
||||
|
||||
@@ -22,7 +22,8 @@ export class ListOfJumpsComponent implements OnInit {
|
||||
'jumpDate',
|
||||
'jumpType',
|
||||
'aircraft',
|
||||
'dropZone'
|
||||
'dropZone',
|
||||
'actions'
|
||||
];
|
||||
public dataSourceTable;
|
||||
public resultsLength = 0;
|
||||
@@ -51,11 +52,15 @@ export class ListOfJumpsComponent implements OnInit {
|
||||
|
||||
openDialog(item: JumpResp) {
|
||||
this.dialog.open(JumpInfosComponent, {
|
||||
data: item //,
|
||||
// position: {
|
||||
// top: '0px',
|
||||
// left: '0px'
|
||||
// }
|
||||
data: item
|
||||
});
|
||||
}
|
||||
|
||||
delete(item: JumpResp) {
|
||||
let data : Array<JumpResp> = this.dataSourceTable.data;
|
||||
data = data.filter(d => d.id !== item.id);
|
||||
this.dataSourceTable.data = data;
|
||||
|
||||
this.serviceApi.DeleteJump(item);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user