Skip to content

Instantly share code, notes, and snippets.

@GustavoGLD
Created February 7, 2023 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GustavoGLD/a8eb3e2c05cb35ac83814e10675b2f73 to your computer and use it in GitHub Desktop.
Save GustavoGLD/a8eb3e2c05cb35ac83814e10675b2f73 to your computer and use it in GitHub Desktop.
streamlit-aggrid checkbox minimal example
from st_aggrid import AgGrid, GridUpdateMode
import pandas as pd
df = pd.DataFrame({"Numeros": list(range(250))})
gridOptions = {
# enable Master / Detail
"masterDetail": True,
"rowSelection": "multiple",
# the first Column is configured to use agGroupCellRenderer
"columnDefs": [
{
"field": "Numeros",
"checkboxSelection": True,
"editable": True,
},
],
"defaultColDef": {
"flex": 1,
},
}
AgGrid(
df,
gridOptions=gridOptions,
height=500,
allow_unsafe_jscode=True,
enable_enterprise_modules=True,
update_mode=GridUpdateMode.SELECTION_CHANGED
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment