Ag-grid Height=100% Collapsed
Answer :
This is almost certainly due to you having DOCTYPE html in your html file.
If you do, then you need to ensure that the grids container has a non-0 height to fill, otherwise it will appear as a flat line as you've found.
This is not an ag-Grid specific issue - it's a side effect of not having quirks mode in use.
The easiest thing for you to do is this:
<style> html, body { width: 100%; height: 100%; }
This StackOverflow Question/Answer explains the underlying issue pretty well
You shall try setting the autoHeight of the ag-grid, by setting the DomLayout.
See the sample code below for angular.
onGridReady(params) { this.gridApi = params.api; this.gridColumnApi = params.columnApi; //The ag-grid is not enlarging based on the page height, //so dynamically adjusting the height of the grid this.gridApi.setDomLayout("autoHeight"); }
For reference see this https://plnkr.co/edit/Jb1TD7gbA4w7yclU?preview
Comments
Post a Comment