Improving table list display
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
.table-row-link {
|
||||
cursor: pointer;
|
||||
}
|
||||
@@ -19,15 +19,15 @@
|
||||
<span class="col col-form-label" i18n *ngIf="loading$ | async">Loading...</span>
|
||||
</div>
|
||||
<div class="table-responsive-md">
|
||||
<table class="table table-striped">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th *ngFor="let col of this.displayedColumns" scope="col" sortable="name" (sort)="onSort($event)">{{ col.title }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let row of listData$ | async" (click)="onSelect(row._id)">
|
||||
<td *ngFor="let col of this.displayedColumns">
|
||||
<tr *ngFor="let row of listData$ | async" (click)="onRowClick(row._id)" (auxclick)="onRowMiddleClick(row._id);" class="table-row-link">
|
||||
<td class="text-truncate" *ngFor="let col of this.displayedColumns" style="max-width: 150px;">
|
||||
<ngb-highlight [result]="getColumnValue(row, col.path)" [term]="searchTerm"></ngb-highlight>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -144,10 +144,15 @@ export class ListComponent implements OnInit {
|
||||
this.sortDirection = direction;
|
||||
}
|
||||
|
||||
onSelect(id: string) {
|
||||
onRowClick(id: string) {
|
||||
this.router.navigate([`../${id}`], {relativeTo: this.route});
|
||||
}
|
||||
|
||||
onRowMiddleClick(id: string) {
|
||||
let newUrl = window.location.href.replace('list', id)
|
||||
window.open(newUrl, '_blank');
|
||||
}
|
||||
|
||||
onCreate() {
|
||||
this.router.navigate([`../new`], {relativeTo: this.route});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user