I have Aggrids table in streamlit tabs. If I interact with the rest of the dashboard, then the tables in the other tabs that are not currently being displayed disappear. However, zooming in and out on the page seems to rerender the table. Has anyone else seen this and knows a fix?
Hello @ferdy, sorry for the delay. Here is minimal produceable code of the bug. For context, I need the table to be editable, and for the edits to stick through the session, which is why i added a key to the aggrid object that updates when edits are made.
I also have a screen recording, how can I share it here?
Please let me know if you can think of any fixes
import streamlit as st
import pandas as pd
from st_aggrid import AgGrid, GridOptionsBuilder
if 'aggrid_key' not in st.session_state:
st.session_state.aggrid_key = 0
st.set_page_config(layout="wide",page_title="test",) #set the page view configs
form = st.form('Form')
tabs = form.tabs(['Tab1','Tab2'])
for tab in range(len(tabs)):
tab_obj = tabs[tab].container()
df = pd.read_csv("test_params.csv")
gb = GridOptionsBuilder.from_dataframe(df)
data = AgGrid(
submit = form.form_submit_button()
if __name__ == '__main__':
Unfortunately this package is not pip installable directly from git. You’ll have to clone/download the repo, build the frontend, and then install with pip. To build the frontend, make sure node.js and yarn are installed, then after cloning/downloading the repo run yarn && yarn build. This will generate st_aggrid/frontend/build. Then, from the base repo directory run pip install . to install the package from the current directory.
Thank you for testing! I just tested and saw similar issues with your example code. I updated the way streamlit-aggrid determines when to update its container size and just pushed a new commit to my repo. Please pull the latest, rebuild, and test again. Thanks!
Hi, I am having the same error (the grid is inside a tab if I use the widget on another tab the grid disappears, it only appears if I zoom in or refresh the page). I just update streamlit-aggrid (version 0.3.4.post3) but it didn’t work