PablocFonseca / streamlit-aggrid

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

Fix issue with st.tabs where grids on inactive tabs disappear #204

Closed broccoliboy closed 7 months ago

broccoliboy commented 1 year ago

Grids on inactive tabs get updated to height=0 when app reruns. Sometimes they update when switching to the tab they reside on, sometimes not. I saw inconsistent behavior depending on normal vs wide mode in settings. This PR seems to solve the issue on both. See #159

broccoliboy commented 1 year ago

Auto column sizing still does not work properly. Working on a fix for this...

broccoliboy commented 1 year ago

Fixed issue with auto column width. Use gridOptions.suppressColumnVirtualisation=True for relatively small grids for proper column sizing. See https://www.ag-grid.com/javascript-data-grid/column-sizing/#auto-size-columns for details on column sizing limitations with virtualization.

broccoliboy commented 1 year ago

Fixed clipping on last column and bottom of table

broccoliboy commented 1 year ago

Updated to use ag-grid gridSizeChanged event for all resizing needs

Quajijalon commented 1 year ago

Hey @broccoliboy, I download your version and placed it both in the project root and, in a separate attempt, in Lib\site-packages but I was unable to create an AgGrid. Is there some pre-preparation that has to be done to the source code before it can be imported into a streamlit project?

broccoliboy commented 1 year ago

Hi @Quajijalon, please see this comment for instructions on building the frontend.

uriyacovy commented 1 year ago

@broccoliboy , @PablocFonseca, The fix is working great for me (after manually building) on three different platforms (Ubuntu, windows 10 & 11). I'd be glad this this can be pulled to the official release.

ctrimborn commented 1 year ago

Hi @broccoliboy thanks for your effort to improve aggrid, unfortunately i ran into the issue that the iframe is not set to height 0 but still the grid doesnt get rendered correctly. Using Streamlit 1.24.1

grafik