Skip to content

Commit 7237a23

Browse files
committed
fix(core): pagination set in global config should work, fixes #879
1 parent 8437daf commit 7237a23

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/app/modules/angular-slickgrid/components/angular-slickgrid.component.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1187,8 +1187,9 @@ export class AngularSlickgridComponent implements AfterViewInit, OnDestroy {
11871187
// using jQuery extend to do a deep clone has an unwanted side on objects and pageSizes but ES6 spread has other worst side effects
11881188
// so we will just overwrite the pageSizes when needed, this is the only one causing issues so far.
11891189
// jQuery wrote this on their docs:: On a deep extend, Object and Array are extended, but object wrappers on primitive types such as String, Boolean, and Number are not.
1190-
if (options?.pagination && (gridOptions.enablePagination || gridOptions.backendServiceApi) && gridOptions.pagination && Array.isArray(gridOptions.pagination.pageSizes)) {
1191-
options.pagination.pageSizes = gridOptions.pagination.pageSizes;
1190+
if (options?.pagination && (gridOptions.enablePagination || gridOptions.backendServiceApi) && (this.forRootConfig.pagination || gridOptions.pagination)) {
1191+
options.pagination.pageSize = gridOptions.pagination?.pageSize ?? this.forRootConfig.pagination?.pageSize ?? GlobalGridOptions.pagination!.pageSize;
1192+
options.pagination.pageSizes = gridOptions.pagination?.pageSizes ?? this.forRootConfig.pagination?.pageSizes ?? GlobalGridOptions.pagination!.pageSizes;
11921193
}
11931194

11941195
// also make sure to show the header row if user have enabled filtering

0 commit comments

Comments
 (0)