moved customized aggrid into separate file
This commit is contained in:
31
stand.py
31
stand.py
@ -1,10 +1,9 @@
|
||||
import streamlit as st
|
||||
from st_aggrid import AgGrid, GridOptionsBuilder
|
||||
|
||||
import hacks
|
||||
|
||||
from aggrid import aggrid
|
||||
from restapi import restapi
|
||||
from utils import make_key
|
||||
from utils.st_utils import get_session_id, rerun, hide_UI_elements
|
||||
from utils.df_utils import to_excel_binary
|
||||
|
||||
@ -56,35 +55,13 @@ with col1:
|
||||
|
||||
|
||||
|
||||
gob = GridOptionsBuilder.from_dataframe(
|
||||
response = aggrid(
|
||||
df,
|
||||
editable=True,
|
||||
filterable=True,
|
||||
groupable=True,
|
||||
resizable=True,
|
||||
sortable=True
|
||||
)
|
||||
|
||||
gob.configure_auto_height(True)
|
||||
go = gob.build()
|
||||
|
||||
#st.write(go)
|
||||
|
||||
response = AgGrid(
|
||||
df[::-1],
|
||||
go,
|
||||
|
||||
theme="streamlit",
|
||||
|
||||
fit_columns_on_grid_load=True,
|
||||
|
||||
reload_data=changed,
|
||||
key=make_key(df)
|
||||
reload_data=changed
|
||||
)
|
||||
|
||||
|
||||
new_df = response.get("data")#, df)
|
||||
new_df = new_df[::-1]
|
||||
new_df = response["data"]
|
||||
if not new_df.equals(df) and not changed:
|
||||
restapi.data = new_df
|
||||
# print("old:")
|
||||
|
Reference in New Issue
Block a user