I'm using angular and aggrid and I would like my grid to adapt in height in a mat expansion panel to take all the screen available space when opened. How can I do that, preferably in css?
It seems that aggrid is adapting to container and mat expansion to content.
I want also the text in orange to be fixed at the bottom of the panel and have the scrollbar only for the grid.
I made a plunker to help: https://plnkr.co/edit/Y0tJ1yoDb5LhDB8a
<div style="height: 500px; background-color:red; ">
<mat-accordion multi displayMode="flat" style="margin: 10px;">
<mat-expansion-panel expanded="true" class="mat-elevation-z1" style="background-color:blue;" >
<mat-expansion-panel-header>
<mat-panel-title>Panel 1</mat-panel-title>
</mat-expansion-panel-header>
text<br> text<br> text<br> text
</mat-expansion-panel>
<mat-expansion-panel expanded="true" class="mat-elevation-z1" style="background-color:green;">
<mat-expansion-panel-header>
<mat-panel-title>Panel 2</mat-panel-title>
</mat-expansion-panel-header>
text<br> text<br> text<br> text
</mat-expansion-panel>
<mat-expansion-panel expanded="true" class="mat-elevation-z1" style="background-color: white;">
<mat-expansion-panel-header>
<mat-panel-title>Panel aggrid</mat-panel-title>
</mat-expansion-panel-header>
<ag-grid-angular
#agGrid
style="height:100px"
id="myGrid"
class="ag-theme-alpine"
[modules]="modules"
[columnDefs]="columnDefs"
[rowData]="rowData"
(gridReady)="onGridReady($event)"
></ag-grid-angular>
<div style="background-color: orange" >
This text should always be visible when expanded. aggrid should adapt to content
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
Thanks