Skip to content

Commit

Permalink
Merge pull request #16130 from ymg2006/double-sort-on-lazy-issue
Browse files Browse the repository at this point in the history
closes #16070 Table> double call to (onLazyLoad) event
  • Loading branch information
cetincakiroglu authored Aug 1, 2024
2 parents 09fc45f + 9d885e5 commit 446c054
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app/components/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1586,7 +1586,7 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable
field: field,
order: order
});
} else {
} else if (!this.lazy) {
this.value.sort((data1, data2) => {
let value1 = ObjectUtils.resolveFieldData(data1, field);
let value2 = ObjectUtils.resolveFieldData(data2, field);
Expand All @@ -1604,7 +1604,7 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable
this._value = [...this.value];
}

if (this.hasFilter()) {
if ((!this.lazy || this.customSort) && this.hasFilter()) {
this._filter();
}
}
Expand Down Expand Up @@ -1634,15 +1634,15 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable
mode: this.sortMode,
multiSortMeta: this.multiSortMeta
});
} else {
} else if (!this.lazy) {
this.value.sort((data1, data2) => {
return this.multisortField(data1, data2, <SortMeta[]>this.multiSortMeta, 0);
});

this._value = [...this.value];
}

if (this.hasFilter()) {
if ((!this.lazy || this.customSort) && this.hasFilter()) {
this._filter();
}
}
Expand Down

0 comments on commit 446c054

Please sign in to comment.