【发布时间】:2020-12-03 16:41:30
【问题描述】:
我正在开发一个 Angular 项目,我在其中动态地将行添加到表中。
我的html代码
<table class="table table-sm table-bordered"
style="width:100%; margin-bottom: 0em">
<thead>
<tr class="bg-header">
<th>
Select
</th>
<the>
Level
</th>
<th>
Config
</th>
<th>
Read
</th>
<th>
Value
</th>
</tr>
</thead>
<tbody>
<tr *ngFor = "let applicableLevel of applicableLevelsConfigList">
<td>
<mat-checkbox>
</mat-checkbox>
</td>
<td>
{{applicableLevel.Nm}}
</td>
<td>
<mat-checkbox [diabled]="true">
</mat-checkbox>
</td>
<td>
<mat-checkbox [diabled]="true">
</mat-checkbox>
</td>
<td>
<mat-checkbox [diabled]="true">
</mat-checkbox>
</td>
</tr>
</tbody>
</table>
我在行的开头有一个复选框,然后是行名,然后是其余列的 3 个复选框。我想最初禁用行名称之后的这些复选框。
如果选中列(第一列)下的复选框,那么我想为该特定行启用其他三个复选框,而其他列的这三个复选框仍然必须禁用,因为行数是动态的。
【问题讨论】:
标签: angular checkbox html-table angular-material