Hello,
I think there is a problem with autoHeight in ag-grid if the grid is above a certain size.
Using the example in the docs and tweaking it a bit:
"""
Grid size
"""
import dash_ag_grid as dag
from dash import Dash, html, dcc
app = Dash(__name__)
columnDefs = [{"field": "make"}, {"field": "model"}, {"field": "price"}]
data = [
{"make": "Toyota", "model": "Celica", "price": 35000},
{"make": "Ford", "model": "Mondeo", "price": 32000},
{"make": "Porsche", "model": "Boxster", "price": 72000},
{"make": "BMW", "model": "M50", "price": 60000},
] * 5
app.layout = html.Div(
[
dcc.Markdown("Default grid size"),
dag.AgGrid(
id="default-grid-size-example",
columnDefs=columnDefs,
rowData=data,
columnSize="sizeToFit",
dashGridOptions={"domLayout": "autoHeight"},
),
dcc.Markdown("Grid size with auto height", style={"marginTop": 30}),
dag.AgGrid(
id="auto-height-example",
columnDefs=columnDefs,
rowData=data,
columnSize="sizeToFit",
),
],
style={"margin": 20},
)
if __name__ == "__main__":
app.run_server(debug=True)
all i’ve done here is making the data 5 times bigger and making the autoHeight grid the first one instead of the second one.
I then get the second table displaying in the middle of the first one - and the markdown text has disappeared, eaten by the first table.