【问题标题】:How to add select all for each column separately in dynamic table angular 2如何在动态表角度2中分别为每一列添加全选
【发布时间】:2018-09-13 02:02:58
【问题描述】:

我设计了动态输入矩阵表。在那需要为每列添加全选选项。该怎么做?

这里代码:

<table [ngClass]="{'isDisplay': hasACLAccess}" class="responsive-table-input-matrix" id="matrixTable">
    <thead>
        <tr>  
            <th>Features/Roles</th>
            <th *ngFor="let column of TableConfiguration.columns;">
                {{column.title}}
            <th>
        </tr>
    </thead>
    <tbody *ngFor=" let feature of featureNameList">
        <tr>
            <td>{{feature.name}}</td>
            <td *ngFor="let a of feature.roles">
            <input name="access" [(ngModel)]="a.access" type="checkbox" 
                (change)="accessArrayList($event)">
            </td>
        </tr>
     </tbody>
</table>

提前致谢。

这里,如果HR的复选框被选中,那么所有属于HR列的复选框都应该被选中,同样对于未选中的状态。

【问题讨论】:

  • 对不起,你的问题不清楚。 “需要为每列添加全选选项”是什么意思?无论我单击哪个复选框都被选中?还是一个选择所有子复选框的主复选框?
  • 如果主复选框被选中,那么特定列的子复选框需要处于选中状态
  • 你能提供一些符合预期结果的模型吗?
  • 我已经编辑了帖子。请检查。

标签: javascript html angular


【解决方案1】:
猜你喜欢
  • 2018-04-21
  • 2020-04-05
  • 2018-10-11
  • 1970-01-01
  • 2018-06-22
  • 1970-01-01
  • 1970-01-01
  • 2018-08-11
  • 2018-07-03
相关资源
最近更新 更多