0

I have designed dynamic input matrix table. In that need to add select all option for each column. How to do that?

Here code:

<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>

Thanks in advance.

enter image description here

In this, if checkbox of HR checked, then all checkboxes belongs to HR column should select, likewise for unchecked state also.

Newbie007
  • 169
  • 1
  • 5
  • 13
  • Sorry, your question is not clear. What do you mean by "In that need to add select all option for each column."? No matter what checkbox I click all get selected? Or one main checkbox that selects all sub-checkboxes? –  Apr 03 '18 at 17:04
  • If main checkbox get seleccted, then that sub checkbox of particular column need to be in checked state – Newbie007 Apr 03 '18 at 17:44
  • can you provide some mockups with desired result? – artemnih Apr 03 '18 at 19:11
  • I have edited the post. Please check. – Newbie007 Apr 04 '18 at 05:54
  • Possible duplicate of [How to select all checkbox in angular 2?](https://stackoverflow.com/questions/44933583/how-to-select-all-checkbox-in-angular-2) – artemnih Apr 04 '18 at 19:22

0 Answers0