Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion nicegui/elements/aggrid/aggrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ export default {
return runMethod(this.api.getRowNode(row_id), name, args);
},
handle_event(type, args) {
if (type === "gridSizeChanged" && this.auto_size_columns) {
if (
type === "gridSizeChanged" &&
this.auto_size_columns &&
!this.gridOptions.columnDefs?.some((col) => col.flex !== undefined)
) {
this.api.sizeColumnsToFit();
}
this.$emit(type, {
Expand Down
2 changes: 2 additions & 0 deletions nicegui/elements/aggrid/aggrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ def __init__(self,

The methods ``run_grid_method`` and ``run_row_method`` can be used to interact with the AG Grid instance on the client.

**Updated in NiceGUI 3.1.0:** The ``auto_size_columns`` option is only respected if no column has a ``flex`` option set.

:param options: dictionary of AG Grid options
:param html_columns: list of columns that should be rendered as HTML (default: ``[]``)
:param theme: AG Grid theme "quartz", "balham", "material", or "alpine" (default: ``options['theme']`` or "quartz")
Expand Down