Skip to content

Commit

Permalink
fix: emit page objects when changing page offset (#45)
Browse files Browse the repository at this point in the history
Allows to keep external pagination components to be in sync with current page.
  • Loading branch information
chintankavathia authored Mar 19, 2024
1 parent c109299 commit cb3e8ea
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,13 @@ export class DatatableComponent implements OnInit, DoCheck, AfterViewInit, After
// Always go to first page when sorting to see the newly sorted data
this.offset = 0;
this.bodyComponent.updateOffsetY(this.offset);
// Emit the page object with updated offset value
this.page.emit({
count: this.count,
pageSize: this.pageSize,
limit: this.limit,
offset: this.offset
});
this.sort.emit(event);
}

Expand Down

0 comments on commit cb3e8ea

Please sign in to comment.