PablocFonseca / streamlit-aggrid

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

Bottom of AgGrid disappears - pagination and horizontal scrolling gone #231

Open VolgardTheScientist opened 1 year ago

VolgardTheScientist commented 1 year ago

Bottom of my AgGrid component disappears - I cannot use pagination nor scroll horizontally. AgGrid

The code I am using is: def AgGrid_with_display_rules(df): gd = GridOptionsBuilder.from_dataframe(df) gd.configure_pagination(enabled=False, paginationAutoPageSize=False, paginationPageSize=3) gd.configure_default_column(editable=False, groupable=True) gd.configure_selection(selection_mode='multiple', use_checkbox=True) gridoptions = gd.build() grid_table = AgGrid(df, gridOptions=gridoptions, update_mode=GridUpdateMode.SELECTION_CHANGED, height=400, allow_unsafe_jscode=True ) sel_row = grid_table["selected_rows"] return grid_table, sel_row

And then I am calling the function with: with st.container(): grid_table, sel_row = AgGrid_with_display_rules(df) sel_row_for_map = pd.DataFrame(sel_row)

I was hoping that st.container might resolve the issue, but not. Same problem with and without st.container. Also I don’t have any CSS that could be causing a problem.

I have also tried this: St-aggrid horizontal scroll bar disappears when I define a height - #9 by Egos but without success.

I am currently on AGgrid: 0.3.4.post3 - the 0.3.3 does cause my app to crash so I cannot downgrade.

I have also raised this on Streamlit Forum: https://discuss.streamlit.io/t/bottom-of-aggrid-disappears-pagination-and-horizontal-scrolling-gone/49417

Will be grateful for any hints on how to handle this! Thanks.

dwaltsch commented 1 year ago

for people having the same issue with pagination dissapearing someone posted the solution here add custom_css={"#gridToolBar": {"padding-bottom": "0px !important"}} in the aggrid build options

VolgardTheScientist commented 1 year ago

Thanks, that solves the problem!