From 23bed7b843d718b838de51269f9cc1039ffe726b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Wed, 10 Jul 2024 15:34:52 +0300 Subject: [PATCH] Fixed #15550 - Table | Custom sort in table not working --- src/app/components/table/table.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/app/components/table/table.ts b/src/app/components/table/table.ts index 0a282032d2a..a5c4a3cee6e 100644 --- a/src/app/components/table/table.ts +++ b/src/app/components/table/table.ts @@ -1555,9 +1555,9 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable this.restoringSort = false; } - if (this.lazy) { - this.onLazyLoad.emit(this.createLazyLoadMetadata()); - } else if (this.value) { + this.lazy && this.onLazyLoad.emit(this.createLazyLoadMetadata()); + + if (this.value) { if (this.customSort) { this.sortFunction.emit({ data: this.value, @@ -1605,9 +1605,8 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable } if (this.multiSortMeta) { - if (this.lazy) { - this.onLazyLoad.emit(this.createLazyLoadMetadata()); - } else if (this.value) { + this.lazy && this.onLazyLoad.emit(this.createLazyLoadMetadata()); + if (this.value) { if (this.customSort) { this.sortFunction.emit({ data: this.value,