【发布时间】:2019-02-01 19:12:13
【问题描述】:
我有一个显示正在执行的作业列表的垫表。 目前我在所有行前面都有停止和重新执行按钮。 现在我只想在第一行显示按钮。 我该怎么做?
mat-table 中按钮的代码
<ng-container matColumnDef="actions">
<mat-header-cell *matHeaderCellDef> </mat-header-cell>
<mat-cell *matCellDef="let element; let index = index">
<button
mat-icon-button
(click)="stop_exec_job(element)"
matTooltip="Stop Executing the Job"
[disabled]="element.status == 'Completed' || element.status == 'FINISH'"
>
<!-- Edit icon for row -->
<i class="material-icons" style="color:red"> stop </i>
</button>
<!-- Delete icon for row -->
<button
mat-icon-button
(click)="re_run_job(element)"
matTooltip="Re-Run the Job"
[disabled]="
element.status == 'RUNNING' ||
element.status == 'Pending'
"
>
<i class="material-icons" style="color:green">
cached
</i>
</button>
</mat-cell>
</ng-container>
【问题讨论】:
标签: javascript angular typescript angular-material