St.experimental_data_editor reruns script after changing just one cell

I am experiencing the following problem:

I am using the st.experimental_data_editor to edit a csv file. The problem ist that once I edited a single cell streamlit reruns the entire script. I already tried to implement an “update” button, however this does not function.

My code is as follows:

  st.title("Watchlist Stocks")
  streamlit_watchlist_df = st.experimental_data_editor(watchlist, num_rows="dynamic", use_container_width = True, key='listupdate')
  st.button('Update', on_click=update_watchlist(streamlit_watchlist_df))

The expected behaivior is that I can edit multiple cells at one and only commit the changes after pressing the update button.

How can I achieve this? Thank you very much for your support.

Try putting the data editor inside a form.

Thank you. This works.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.