Posted 4 May 2021, 2:53 am EST
Hello, I am using Flexgrid on Angular 10.
All I need to do is add a “Delete Row” Column where if somebody clicks on the trash can icon, it calls the backend and it deletes the row from the database.
Essentially I need something where every row contains a column (A delete column) where if you click on the Trash Can icon for that row, then that particular row would be deleted from the database.
I tried to add this to my the .html part of Angular, but it does not render this propertly
<wj-flex-grid-column class="deleteColumn" [header]="'Delete'" [isReadOnly]="true" format="n2" [binding]="'delete'" onload="a = 1">
sdsadsadas
</wj-flex-grid-column>
I have similar code for using the angular material tables:
<!-- Delete Column -->
<ng-container matColumnDef="delete">
<mat-header-cell *matHeaderCellDef></mat-header-cell>
<mat-cell *matCellDef="let element">
<button
mat-icon-button
color="primary"
(click)="onDeleteService($event, element)"
[disabled]="isDeleteInProcess"
>
<mat-icon *ngIf="serviceUnderDeletion !== element">delete</mat-icon>
<mat-spinner aria-label="loading" *ngIf="serviceUnderDeletion === element" diameter="24"></mat-spinner>
</button>
</mat-cell>
</ng-container>