Skip to content

Commit

Permalink
fix: add autoResize.autoHeight to resize by dataset length (#1310)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding authored Jan 25, 2025
1 parent b7ef2a8 commit 1070d19
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,11 @@ export class AureliaSlickgridCustomElement {
if (this._isLocalGrid && this.gridOptions?.enableEmptyDataWarningMessage) {
this.displayEmptyDataWarning(currentPageRowItemCount === 0);
}

// when autoResize.autoHeight is enabled, we'll want to call a resize
if (this.gridOptions.enableAutoResize && this.resizerService.isAutoHeightEnabled && currentPageRowItemCount > 0) {
this.resizerService.resizeGrid();
}
}

/** Initialize the Pagination Service once */
Expand Down
4 changes: 3 additions & 1 deletion packages/aurelia-slickgrid/src/global-grid-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ export const GlobalGridOptions: Partial<GridOption> = {
autoFitColumnsOnFirstLoad: true,
autoResize: {
applyResizeToContainer: true,
autoHeight: true,
autoHeightRecalcRow: 100,
calculateAvailableSizeBy: 'window',
bottomPadding: 20,
minHeight: 180,
minHeight: 250,
minWidth: 300,
rightPadding: 0
},
Expand Down
1 change: 1 addition & 0 deletions packages/demo/src/examples/slickgrid/example28.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export class Example28 {

this.gridOptions = {
autoResize: {
autoHeight: false,
container: '#demo-container',
rightPadding: 10
},
Expand Down

0 comments on commit 1070d19

Please sign in to comment.