Advertisement
Danila_lipatov

Untitled

Feb 17th, 2023
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. gd = GridOptionsBuilder.from_dataframe(df)
  2. gd.configure_pagination(enabled=True)
  3. gd.configure_default_column(editable=True, groupable=True)
  4. gd.configure_selection(selection_mode="multiple", use_checkbox=True)
  5. gridoptions = gd.build()
  6. grid_table = AgGrid(
  7. df,
  8. gridOptions=gridoptions,
  9. update_mode=GridUpdateMode.SELECTION_CHANGED,
  10. theme="material",
  11. )
  12. sel_row = grid_table["selected_rows"]
  13.  
  14. st.subheader(" ② Check your selection")
  15.  
  16. st.write("")
  17.  
  18. df_sel_row = pd.DataFrame(sel_row)
  19. st.write(df_sel_row)
  20.  
  21. download = st.button('DOWNLOAD TABLE')
  22. csv = df_sel_row.to_excel('large_df_2.xlsx')
  23. if download == True:
  24. st.download_button(label="Download data as xlsx",
  25. data=csv,
  26. mime='text/xlsx')
  27. st.write('CHECK')
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement