added slider to sidebar controlling the grid height (instead of auto height)

This commit is contained in:
2022-06-04 19:14:56 +02:00
parent d9a121c4f3
commit 59000eddde
2 changed files with 11 additions and 2 deletions

View File

@ -17,7 +17,8 @@ icon = Path(__file__).parent.parent / "icon.png"
st.set_page_config(
page_title="stand",
page_icon=str(icon),
layout="wide"
layout="wide",
initial_sidebar_state="collapsed"
)
hide_UI_elements()

View File

@ -1,3 +1,4 @@
import streamlit as st
from st_aggrid import AgGrid, GridOptionsBuilder
@ -13,12 +14,19 @@ def aggrid(df, reload_data=False):
sortable=True
)
gob.configure_auto_height(True)
height = st.sidebar.slider(
"Grid Height",
min_value=100, max_value=1500, value=500, step=10,
key="gridheight"
)
# gob.configure_auto_height(True)
go = gob.build()
response = AgGrid(
df,
go,
height=height,
theme="streamlit",
fit_columns_on_grid_load=True,
reload_data=reload_data,