streamlit-aggrid icon indicating copy to clipboard operation
streamlit-aggrid copied to clipboard

reload_data cannot be set back to False if it has been set to True once

Open fplanque opened this issue 2 years ago • 0 comments

I normally have reload_data=False so that I can make multiple selections. That works fine.

However, if at some point I need to update the data, I will "run the streamlit page" once with reload_data=True .

After that, even if I use reload_data=False, aggrid will reload the data after each selection and I can no longer make multiple selections.

I think there is a bug that prevents aggrid to register that reload_data is set BACK to False.

I have seen reports of the same "sometimes/randomly cannot make multiple selection" on various Google searches. I think this is the root cause.

     grid_response = AgGrid(
             df,
             key = list_key,
             gridOptions=gridOptions,
             data_return_mode=DataReturnMode.FILTERED_AND_SORTED,
             update_mode=GridUpdateMode.SELECTION_CHANGED, 
             fit_columns_on_grid_load=False,
             enable_enterprise_modules=True,
             allow_unsafe_jscode=True,
             height=560, 
             reload_data=reload_data  # True: reload data each time 
         )

fplanque avatar Jan 29 '23 16:01 fplanque