Schluca / streamlit_tree_select

A simple and elegant checkbox tree for Streamlit.
MIT License
80 stars 9 forks source link

on_change callback functions #18

Open markusdr opened 3 months ago

markusdr commented 3 months ago

It would be useful to have a callback mechanism:

def fct_expanded():
    print('Event detected: expanded')

def fct_checked():
    print('Event detected: checked')

tree_select(nodes, on_change_checked=fct_checked, on_change_expanded=fct_expanded)

This would be analogous to the on_change on st.checkbox (https://docs.streamlit.io/develop/api-reference/widgets/st.checkbox) and other components.