Skip to content

Commit cb3e8ea

Browse files
fix: emit page objects when changing page offset (#45)
Allows to keep external pagination components to be in sync with current page.
1 parent c109299 commit cb3e8ea

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

projects/ngx-datatable/src/lib/components/datatable.component.ts

+7
Original file line numberDiff line numberDiff line change
@@ -1163,6 +1163,13 @@ export class DatatableComponent implements OnInit, DoCheck, AfterViewInit, After
11631163
// Always go to first page when sorting to see the newly sorted data
11641164
this.offset = 0;
11651165
this.bodyComponent.updateOffsetY(this.offset);
1166+
// Emit the page object with updated offset value
1167+
this.page.emit({
1168+
count: this.count,
1169+
pageSize: this.pageSize,
1170+
limit: this.limit,
1171+
offset: this.offset
1172+
});
11661173
this.sort.emit(event);
11671174
}
11681175

0 commit comments

Comments
 (0)