Open mmf431 opened 2 months ago
Could you please share some code?
builder = GridOptionsBuilder.from_dataframe(df)
builder.configure_selection( selection_mode='single', suppressRowClickSelection=False ) grid_options = builder.build()
grid_options['defaultColDef'] = {'filter': True}
grid_options['columnDefs'] = [
{'headerName': 'Datum', 'field': 'DATUMZU', 'flex': 1},
{'headerName': 'Bezeichnung', 'field': 'BEZEICHNUNG', 'editable': st.session_state['edit_mode'], 'width': 200},
{'headerName': 'Art', 'field': 'DOMEART', 'flex': 1},
{'headerName': 'Kategorie-Bez.', 'field': 'KATEGBEZ', 'flex': 1},
{'headerName': 'Bereich-Bez.', 'field': 'BEREICHBEZ', 'flex': 1},
{'headerName': 'Status-Bez.', 'field': 'STATUSBEZ', 'flex': 1},
{'headerName': 'pkey', 'field': 'pkey', 'flex': 1},
]
# Display the ag-Grid
ag = AgGrid(df,
height=315,
gridOptions=grid_options,
update_mode = GridUpdateMode.VALUE_CHANGED | GridUpdateMode.SELECTION_CHANGED,
enable_enterprise_modules=False,
allow_unsafe_jscode=True,
key='docgrid'
)
What I recognized is that the grid is displayed correctly in the second and each subsequent run.
Since I made the update from 1.0 to 1.2 my width statement in a columnDef is ignored and the column gets much too broad trying to accomodate all text that is in the largest cell of the column.