PablocFonseca / streamlit-aggrid

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

Getting clicked cell information #135

Closed iheo closed 6 months ago

iheo commented 2 years ago

Hello, how could I get clicked cell information (row and column) and display them in StreamLIt? I was only able to play with "selected cell" :)

Looks like onCellClicked is one of grid options but wonder how to pass that to StreamLit front.

https://www.ag-grid.com/javascript-data-grid/grid-events/

elcronos commented 1 year ago

Same here. Any updates?

yoeldk commented 1 year ago

I also need this feature in order to display additional info for each clicked cell. @PablocFonseca Is there a possibility to capture the clicked cell? I only managed to capture the clicked row by this:

selection = AgGrid(
        df,
        enable_enterprise_modules=True,
        gridOptions=options.build(),
        theme="streamlit",
        update_mode=GridUpdateMode.MODEL_CHANGED,
        allow_unsafe_jscode=True,
    )

if selection:
    st.write("You selected:")
    st.json(selection["selected_rows"])

TIA!!