Fixed sorting

This commit is contained in:
2023-10-15 16:18:09 +02:00
parent c9b967b9d0
commit b8d27cc682
6 changed files with 11 additions and 8 deletions

View File

@@ -5,9 +5,11 @@ import { ComponentWithTable } from "../../../base/component-with-table";
export class HideableComponent {
@HostBinding("class.hidden-column")
get hidden() {
return !(this.parent?.isColumnVisible(this.column) ?? true);
const column = this.subColumn ?? this.column;
return !(this.parent?.isColumnVisible(column) ?? true);
};
@Input() column!: string;
@Input() subColumn!: string;
@Input() parent!: ComponentWithTable;
}

View File

@@ -2,7 +2,7 @@
<ng-content></ng-content>
</ng-template>
<div *ngIf="sortable; else without" [pSortableColumn]="column">
<div *ngIf="sortable; else without" [pSortableColumn]="subColumn ?? column">
<ng-container *ngTemplateOutlet="content"></ng-container>
</div>

View File

@@ -72,10 +72,10 @@
</div>
</th>
<th hideable-th="level" [parent]="this" [sortable]="true">
<th hideable-th="level" subColumn="level.min_xp" [parent]="this" [sortable]="true">
<div class="table-header-label">
<div class="table-header-text">{{'common.level' | translate}}</div>
<p-sortIcon field="level.name" class="table-header-icon"></p-sortIcon>
<p-sortIcon field="level" class="table-header-icon"></p-sortIcon>
</div>
</th>