Skip to content
This repository was archived by the owner on Jun 1, 2025. It is now read-only.

Commit 26838d9

Browse files
committed
fix: add autoResize.autoHeight to resize by dataset length
1 parent e41fe93 commit 26838d9

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/app/examples/grid-tree-data-hierarchical.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ export class GridTreeDataHierarchicalComponent implements OnInit {
138138

139139
this.gridOptions = {
140140
autoResize: {
141+
autoHeight: false,
141142
container: '#demo-container',
142143
rightPadding: 10,
143144
},

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,11 @@ export class AngularSlickgridComponent<TData = any> implements AfterViewInit, On
12621262
if (this._isLocalGrid && this.gridOptions?.enableEmptyDataWarningMessage) {
12631263
this.displayEmptyDataWarning(currentPageRowItemCount === 0);
12641264
}
1265+
1266+
// when autoResize.autoHeight is enabled, we'll want to call a resize
1267+
if (this.gridOptions.enableAutoResize && this.resizerService.isAutoHeightEnabled && currentPageRowItemCount > 0) {
1268+
this.resizerService.resizeGrid();
1269+
}
12651270
}
12661271

12671272
protected initializePaginationService(paginationOptions: Pagination) {

src/app/modules/angular-slickgrid/global-grid-options.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ export const GlobalGridOptions: Partial<GridOption> = {
1818
autoFitColumnsOnFirstLoad: true,
1919
autoResize: {
2020
applyResizeToContainer: true,
21+
autoHeight: true,
22+
autoHeightRecalcRow: 100,
2123
calculateAvailableSizeBy: 'window',
2224
bottomPadding: 20,
23-
minHeight: 180,
25+
minHeight: 250,
2426
minWidth: 300,
2527
rightPadding: 0,
2628
},

0 commit comments

Comments
 (0)