@@ -234,7 +234,7 @@ export class DatatableComponent<TRow extends Row = any>
234234 this . _offset = val ;
235235 }
236236 get offset ( ) : number {
237- return Math . max ( Math . min ( this . _offset , Math . ceil ( this . rowCount / this . pageSize ) - 1 ) , 0 ) ;
237+ return Math . max ( Math . min ( this . _offset , Math . ceil ( this . rowCount / this . pageSize ( ) ) - 1 ) , 0 ) ;
238238 }
239239
240240 /**
@@ -656,7 +656,7 @@ export class DatatableComponent<TRow extends Row = any>
656656
657657 element = inject < ElementRef < HTMLElement > > ( ElementRef ) . nativeElement ;
658658 readonly _innerWidth = computed ( ( ) => this . dimensions ( ) . width ) ;
659- pageSize ! : number ;
659+ readonly pageSize = computed ( ( ) => this . calcPageSize ( ) ) ;
660660 readonly bodyHeight = computed ( ( ) => {
661661 if ( this . scrollbarV ( ) ) {
662662 let height = this . dimensions ( ) . height ;
@@ -823,7 +823,7 @@ export class DatatableComponent<TRow extends Row = any>
823823 if ( this . externalPaging ( ) && this . scrollbarV ( ) ) {
824824 this . page . emit ( {
825825 count : this . count ( ) ,
826- pageSize : this . pageSize ,
826+ pageSize : this . pageSize ( ) ,
827827 limit : this . limit ( ) ,
828828 offset : 0 ,
829829 sorts : this . sorts ( )
@@ -960,7 +960,6 @@ export class DatatableComponent<TRow extends Row = any>
960960 * Recalculates the pages after a update.
961961 */
962962 recalculatePages ( ) : void {
963- this . pageSize = this . calcPageSize ( ) ;
964963 this . rowCount = this . calcRowCount ( ) ;
965964 }
966965
@@ -980,7 +979,7 @@ export class DatatableComponent<TRow extends Row = any>
980979 if ( ! isNaN ( this . offset ) ) {
981980 this . page . emit ( {
982981 count : this . count ( ) ,
983- pageSize : this . pageSize ,
982+ pageSize : this . pageSize ( ) ,
984983 limit : this . limit ( ) ,
985984 offset : this . offset ,
986985 sorts : this . sorts ( )
@@ -1005,7 +1004,7 @@ export class DatatableComponent<TRow extends Row = any>
10051004
10061005 this . page . emit ( {
10071006 count : this . count ( ) ,
1008- pageSize : this . pageSize ,
1007+ pageSize : this . pageSize ( ) ,
10091008 limit : this . limit ( ) ,
10101009 offset : this . offset ,
10111010 sorts : this . sorts ( )
@@ -1160,7 +1159,7 @@ export class DatatableComponent<TRow extends Row = any>
11601159 // Emit the page object with updated offset value
11611160 this . page . emit ( {
11621161 count : this . count ( ) ,
1163- pageSize : this . pageSize ,
1162+ pageSize : this . pageSize ( ) ,
11641163 limit : this . limit ( ) ,
11651164 offset : this . offset ,
11661165 sorts : this . sorts ( )
0 commit comments