|
12 | 12 | <table class="ngx-table ngx-table-striped ngx-table-hover">
|
13 | 13 | <thead>
|
14 | 14 | <tr class="ngx-table__header" *ngIf="config.headerEnabled">
|
15 |
| - <ng-container *ngFor="let key of columns"> |
| 15 | + <ng-container *ngFor="let column of columns"> |
16 | 16 | <th class="ngx-table__header-cell"
|
17 |
| - (click)="orderBy(key)"> |
18 |
| - <div class="ngx-d-inline">{{ key }}</div> |
19 |
| - <span *ngIf="resource.order[key]==='asc' " |
| 17 | + (click)="orderBy(column['key'])"> |
| 18 | + <div class="ngx-d-inline">{{ column['title'] }}</div> |
| 19 | + <span *ngIf="resource.order[column['key']]==='asc' " |
20 | 20 | [style.display]="config.orderEnabled?'':'none' "
|
21 | 21 | class="ngx-icon ngx-icon-arrow-up">
|
22 | 22 | </span>
|
23 |
| - <span *ngIf="resource.order[key]==='desc' " |
| 23 | + <span *ngIf="resource.order[column['key']]==='desc' " |
24 | 24 | [style.display]="config.orderEnabled?'':'none' "
|
25 | 25 | class="ngx-icon ngx-icon-arrow-down">
|
26 | 26 | </span>
|
|
43 | 43 | </tr>
|
44 | 44 | <tr *ngIf="config.searchEnabled"
|
45 | 45 | class="ngx-table__sortHeader">
|
46 |
| - <ng-container *ngFor="let key of columns"> |
| 46 | + <ng-container *ngFor="let column of columns"> |
47 | 47 | <th>
|
48 |
| - <table-header (update)="onSearch($event)" [key]="key"></table-header> |
| 48 | + <table-header (update)="onSearch($event)" [column]="column"></table-header> |
49 | 49 | </th>
|
50 | 50 | </ng-container>
|
51 | 51 | <th *ngIf="config.additionalActions"></th>
|
|
65 | 65 | <tr *ngFor="let row of data | search : term | global : globalSearchTerm | paginate: { itemsPerPage: limit, currentPage: page, totalItems: count };
|
66 | 66 | let rowIndex = index"
|
67 | 67 | [class.ngx-table__table-row--selected]="rowIndex == selectedRow && !config.selectCell">
|
68 |
| - <ng-container *ngFor="let key of columns; let colIndex = index"> |
69 |
| - <td (click)="clickedCell($event, row, key, colIndex, rowIndex)" |
| 68 | + <ng-container *ngFor="let column of columns; let colIndex = index"> |
| 69 | + <td (click)="clickedCell($event, row, column['key'], colIndex, rowIndex)" |
70 | 70 | [class.ngx-table__table-col--selected]="colIndex == selectedCol && !config.selectCell"
|
71 | 71 | [class.ngx-table__table-cell--selected]="colIndex == selectedCol && rowIndex == selectedRow && !config.selectCol && !config.selectRow"
|
72 | 72 | >
|
73 |
| - <div>{{ row[key] }}</div> |
| 73 | + <div>{{ row[column['key']] }}</div> |
74 | 74 | </td>
|
75 | 75 | </ng-container>
|
76 | 76 | <td *ngIf="config.additionalActions"></td>
|
|
0 commit comments