PablocFonseca / streamlit-aggrid

Implementation of Ag-Grid component for Streamlit
https://pypi.org/project/streamlit-aggrid/
MIT License
991 stars 191 forks source link

I can use only one AgGrid table on a page. Is it bug? #218

Open johnnyb1509 opened 1 year ago

johnnyb1509 commented 1 year ago

Hi,

Today, I'm facing the problem of using multiple agGrid table on a streamlit page. Specifically my code is as below:

# df1, df2 get from any source

tab_1, tab_2 = st.tabs(['Tab 1', 'Tab 2'])
with tab_1:
     response_1 = AgGrid(df1, data_return_mode=DataReturnMode.FILTERED_AND_SORTED, height = 300)
     dataPlot_1 = response_1['data']
     # Plotly Figure show.....

with tab_2:
     response_2 = AgGrid(df2, data_return_mode=DataReturnMode.FILTERED_AND_SORTED, height = 300)
     dataPlot_2 = response_2['data']
     # Plotly Figure show.....

On interface, when I tried to filter some columns in table of tab_1, and move to tab_2 to using other agGrid table, the table on tab_2 is disappeared and vice versa. It means that, whenever I use the table, I need to refresh the whole page

How can I do to solve this problem?

broccoliboy commented 1 year ago

Perhaps a duplicate of #159?