Skip to content

Commit

Permalink
fix(resizer): fix a regression bug caused by previous PR #341
Browse files Browse the repository at this point in the history
- resizer service init must be done only after SlickGrid is initialized, else we end up binding our resize to a grid dom element that doesn't yet exist in the DOM
- this regression bug wasn't caught earlier because there's no Cypress E2E to test that since it's too hard to test, basically it was caught manually since I found out the auto-resize stopped working (it failed silently) and I was wondering why that suddenly happened
  • Loading branch information
ghiscoding committed May 21, 2021
1 parent e775cfa commit 462e330
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -558,9 +558,6 @@ export class SlickVanillaGridBundle {
this.sharedService.dataView = this.dataView;
this.sharedService.slickGrid = this.slickGrid;

// load the resizer service
this.resizerService.init(this.slickGrid, this._gridParentContainerElm);

this.extensionService.bindDifferentExtensions();
this.bindDifferentHooks(this.slickGrid, this._gridOptions, this.dataView);
this._slickgridInitialized = true;
Expand All @@ -577,6 +574,10 @@ export class SlickVanillaGridBundle {
// initialize the SlickGrid grid
this.slickGrid.init();

// initialized the resizer service only after SlickGrid is initialized
// if we don't we end up binding our resize to a grid element that doesn't yet exist in the DOM and the resizer service will fail silently (because it has a try/catch that unbinds the resize without throwing back)
this.resizerService.init(this.slickGrid, this._gridParentContainerElm);

// user could show a custom footer with the data metrics (dataset length and last updated timestamp)
if (!this.gridOptions.enablePagination && this.gridOptions.showCustomFooter && this.gridOptions.customFooterOptions) {
this.slickFooter = new SlickFooterComponent(this.slickGrid, this.gridOptions.customFooterOptions, this.translaterService);
Expand Down

0 comments on commit 462e330

Please sign in to comment.