This repository was archived by the owner on Dec 25, 2021. It is now read-only.
forked from MIt9/angular-4-data-table
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathrow.component.html
More file actions
43 lines (43 loc) · 2.52 KB
/
row.component.html
File metadata and controls
43 lines (43 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<tr class="data-table-row"
[title]="getTooltip()"
[style.background-color]="dataTable.getRowColor(item, index, _this)"
[class.row-odd]="index % 2 === 0"
[class.row-even]="index % 2 === 1"
[class.selected]="selected"
[class.clickable]="dataTable.selectOnRowClick">
<td [hide]="!dataTable.expandColumnVisible">
<button (click)="expandButtonClicked()" class="row-expand-button"
[attr.aria-expanded]="expanded"
[title]="dataTable.labels.expandRow.replace('{cell_content}', ''+item[dataTable.primaryColumn])"
[attr.aria-label]="dataTable.labels.expandRow.replace('{cell_content}', ''+item[dataTable.primaryColumn])">
<i [ngClass]="{'fa-caret-right': !expanded, 'fa-caret-down': expanded}" class="fa fa-lg" aria-hidden="true"></i>
</button>
</td>
<td [hide]="!dataTable.indexColumnVisible" class="index-column" [textContent]="displayIndex"></td>
<td [hide]="!dataTable.selectColumnVisible" class="select-column">
<input type="checkbox" [(ngModel)]="selected"
[title]="dataTable.labels.selectRow.replace('{cell_content}', ''+item[dataTable.primaryColumn])"
[attr.aria-label]="dataTable.labels.selectRow.replace('{cell_content}', ''+item[dataTable.primaryColumn])"/>
</td>
<ng-template ngFor [ngForOf]="dataTable.columns" let-column>
<th *ngIf="dataTable.primaryColumn === column.property" scope="row" [hide]="!column.visible" [ngClass]="column.styleClassObject"
class="data-column"
[style.background-color]="column.getCellColor(_this, index)">
<div *ngIf="!column.cellTemplate" [textContent]="item[column.property]"></div>
<div *ngIf="column.cellTemplate" [ngTemplateOutlet]="column.cellTemplate"
[ngTemplateOutletContext]="{column: column, row: _this, item: item}"></div>
</th>
<td *ngIf="dataTable.primaryColumn !== column.property" [hide]="!column.visible" [ngClass]="column.styleClassObject"
class="data-column"
[style.background-color]="column.getCellColor(_this, index)">
<div *ngIf="!column.cellTemplate" [textContent]="item[column.property]"></div>
<div *ngIf="column.cellTemplate" [ngTemplateOutlet]="column.cellTemplate"
[ngTemplateOutletContext]="{column: column, row: _this, item: item}"></div>
</td>
</ng-template>
</tr>
<tr *ngIf="dataTable.expandableRows" [hide]="!expanded" class="row-expansion">
<td [attr.colspan]="dataTable.columnCount">
<div [ngTemplateOutlet]="dataTable.expandTemplate" [ngTemplateOutletContext]="{row: _this, item: item}"></div>
</td>
</tr>