fix datatable multi select checkboxes (#1784)

* fix datatable multi select checkboxes

* template cleanup

* fix unit tests
This commit is contained in:
Denys Vuika
2017-03-30 09:44:34 +01:00
committed by Vito
parent 4ef560e7f5
commit fa448374a9
4 changed files with 18 additions and 62 deletions

View File

@@ -9,13 +9,7 @@
</th>
<!-- Columns -->
<th *ngIf="multiselect">
<label
class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect mdl-data-table__select"
[class.is-checked]="isSelectAllChecked"
for="table-header"
(click)="onSelectAllClick($event)">
<input type="checkbox" id="table-header" class="mdl-checkbox__input" />
</label>
<md-checkbox [checked]="isSelectAllChecked" (change)="onSelectAllClick($event)"></md-checkbox>
</th>
<th class="mdl-data-table__cell--non-numeric non-selectable {{col.cssClass}}"
*ngFor="let col of data.getColumns()"
@@ -57,12 +51,7 @@
</td>
<td *ngIf="multiselect">
<label
class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect mdl-data-table__select"
[attr.for]="'row[' + idx + ']'"
[class.is-checked]="row.isSelected">
<input type="checkbox" [attr.id]="'row[' + idx + ']'" class="mdl-checkbox__input" [(ngModel)]="row.isSelected" />
</label>
<md-checkbox [(ngModel)]="row.isSelected"></md-checkbox>
</td>
<td *ngFor="let col of data.getColumns()" [ngSwitch]="col.type"
class="mdl-data-table__cell--non-numeric non-selectable data-cell {{col.cssClass}}"