Skip to content

Commit

Permalink
Fixed #5546 -Table.reset() shouldn't reset the sortOrder to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Oct 23, 2018
1 parent 60876b9 commit 81021e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/components/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,7 @@ export class Table implements OnInit, AfterContentInit, BlockableUI {

public reset() {
this._sortField = null;
this._sortOrder = 1;
this._sortOrder = this.defaultSortOrder;
this._multiSortMeta = null;
this.tableService.onSort(null);

Expand Down

1 comment on commit 81021e7

@kkganesan
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cagataycivici
Would like to see sortField set to the one defined in the template on reset as well.
Alternative way would be to have an options passed as parameter to reset(), with options containing properties targeting every setter on reset method.

With existing table version, to reset a sortfield, the property will have to explicitly called by accessing from ViewChild, however it would trigger a lazy load event (if set by default) everytime, the same can be obviated if there is a handle through reset().

Would appreciate your reply on the same.

Please sign in to comment.