diff --git a/stand/widgets/aggrid.py b/stand/widgets/aggrid.py index 60a680e..ea94ede 100644 --- a/stand/widgets/aggrid.py +++ b/stand/widgets/aggrid.py @@ -13,8 +13,8 @@ def aggrid(df, reload_data=False, height="auto", pagination=True): sortable=True ) - enable_auto_height = (height == "auto") - gob.configure_auto_height(enable_auto_height) + auto_height = (height == "auto") + gob.configure_auto_height(auto_height) gob.configure_pagination(pagination) go = gob.build() @@ -26,7 +26,7 @@ def aggrid(df, reload_data=False, height="auto", pagination=True): theme="streamlit", fit_columns_on_grid_load=True, reload_data=reload_data, - key=make_key(df, enable_auto_height, pagination) + key=make_key(df, auto_height, pagination) ) df = response.get("data", df) @@ -36,14 +36,14 @@ def aggrid(df, reload_data=False, height="auto", pagination=True): -def make_key(df, enable_auto_height, pagination): +def make_key(df, auto_height, pagination): """ encode the dataframe's column names into a key, as well as the state of the auto height and pagination settings, this triggers a hard reload (like F5) of the AgGrid if the columns/settings change """ items = list(df.columns) - items.append(enable_auto_height) + items.append(auto_height) items.append(pagination) return "stand:" + "+".join(str(i) for i in items)