question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Grid not resizing with re sizable div

See original GitHub issue

I’m submitting a bug report

  • Angular Version: 7.2.14

  • Library Version: 2.5.3

  • Browser: Chrome 73.0.3683.103

  • Language: TypeScript 3.1.1

Current behavior: I have a re-sizable div that can be changed to nearly and height or width on the fly. When the div is adjusted, The grid does not stay inside the dimensions of the div. In fact, it doesn’t do anything at all. These are my grid options

<angular-slickgrid gridId="grid1"
      style="width:100%;height:100%"
            [columnDefinitions]="columnDefinitions"
            [gridOptions]="gridOptions"
            [dataset]="dataset"
            (onAngularGridCreated)="angularGridReady($event)">
            >

 this.gridOptions = {
      enableAutoResize: true,       // true by default
      enableCellNavigation: true,
      autoEdit: true, /* when enabled will automatically open the inlined editor as soon as there is a focus on the cell (can be combined with "enableCellNavigation: true"). */
      autoHeight: false,
      autoResize: {
        containerId:`${this.selector}div`,
        delay: 0,
        sidePadding: 4,
        bottomPadding: 4
      }
    };

Setting autoHeight to True doesn’t appear to change much

Expected/desired behavior: Setting the autoResize grid option with the correct container would correctly set the dimensions of the grid. I have searched the documentation on this and am unable to find anything that has been of use. I have attached an image, if you are able to open those 😃 notresize

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:32 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
ghiscodingcommented, May 1, 2019

First the autoHeight is probably not what you think it is, it’s an option available in the SlickGrid core lib and it basically draw the entire grid height without any scrolling, for example if the grid has 100 items, all 100 items will be shown in the grid and the only scrolling you’ll have is the browser scrolling. This option is really badly name, perhaps fullHeight might have been better, but again that comes from the core lib, not mine.

As for the autoResize, which is implemented within my lib, it needs a Div container for it to work properly. Also it uses the window.resize and when you change the grid size dynamically you will find out that it might not always call a resize (probably your problem). For example in our project, we have a sidebar that can be opened and we do this programmatically (by changing Bootstrap col-md-x size) and that doesn’t trigger a window.event, so to circumvent this issue, you can call the resize manually like so

  angularGridReady(angularGrid: AngularGridInstance) {
    this.angularGrid = angularGrid;
  }

  closeSidebar() {
    this.isSidebarOpen = false;
    this.angularGrid.resizerService.resizeGrid();
  }

  openSidebar() {
    this.isSidebarOpen = true;
    this.angularGrid.resizerService.resizeGrid();
  }
1reaction
ghiscodingcommented, May 7, 2019

Sometime this week

Read more comments on GitHub >

github_iconTop Results From Across the Web

grid layout with resize horizontal not resizing columns [duplicate]
I've got a grid layout and I'm using resize: horizontal on one. It lets me resize the box but it doesn't resize the...
Read more >
resize - CSS: Cascading Style Sheets - MDN Web Docs - Mozilla
The resize CSS property sets whether an element is resizable, and if so, in which directions.
Read more >
Issue with grid and resizing in one direction - jQuery UI
click on any box to place a new div. Works correctly when resizing from east, but when resizing from west is not possibile...
Read more >
Resize and Expand to 100% Height - Kendo UI Grid for jQuery
An example on how to resize and expand it to 100% height when the parent container or browser window are resized too.
Read more >
Column Sizing - React Data Grid
All columns can be resized by dragging the top right portion of the column. Enable Sizing. Turn column resizing on for the grid...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found