[ACA-4205] reload on sorting only for server mode (#6420)

* reload on sorting only for server mode

* cleanup demo shell / files
This commit is contained in:
Denys Vuika
2020-12-04 17:36:02 +00:00
committed by GitHub
parent 5b603ee018
commit 31bac2da24
2 changed files with 25 additions and 36 deletions

View File

@@ -201,7 +201,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
* before delivering it.
*/
@Input()
sortingMode = 'server';
sortingMode: 'server' | 'client' = 'server';
/** The inline style to apply to every row. See
* the Angular NgStyle
@@ -707,8 +707,11 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
onSortingChanged(event: CustomEvent) {
this.orderBy = this.buildOrderByArray(event.detail.sortingKey, event.detail.direction);
this.reload();
this.sortingSubject.next([this.additionalSorting, event.detail]);
if (this.sortingMode === 'server') {
this.reload();
}
}
private buildOrderByArray(currentKey: string, currentDirection: string): string[] {