Experimental_data_editor: How to retrieve selection?

Experimental_data_editor: How to retrieve selection?

Great new widget! Through session state, itโ€™s easy to catch edited cells, as well as added and deleted rows.

Expected behavior:

Is there a way to retrieve selected rows by user? For instance, in order to refresh some charts or display more details based on the selected row or cell?

Thanks a lot

Debug info

  • Streamlit version: 1.20
  • Python version: 3.10
  • Using Anaconda
  • OS version: macos Ventura 13.3
  • Browser version: safari v16.4

Since row selection does not cause page reruns, it would appear the row selection is a purely front-end action at this time. However, you could could add another column to your dataframe of boolean type and use that to get information from the user about row selection.

1 Like

Thanks Mathcatsand!
Hope this event will be implemented soon.
In the meanwhile, Iโ€™ll stick with the AgGrid โ€ฆ

Hey Michell! Yes, we want to implement selections on rows. Unfortunately, we had to pause it for a while because we are currently focusing on some higher-priority features. But we hope to get back to it in a few months!

Btw you can always follow at roadmap.streamlit.app


Row selection would be a great feature. My use-case has parent/child tables, like to have parent row to trigger child table. Agree with @Michell, will use aggrid now and wait for future release. Thanks

@jrieke can we get an update on this feature request? Iโ€™d like to retrieve the cell (or at least the row) that the user has selected for the st.data_editor. My use case is the value in the cell is passed into an API call.

I understand that a โ€œhackโ€ is to add a checkbox for each row, but I find row/cell selection to be a much nicer experience.

Any updates? this would really unblock analytics hehe

1 Like

You will need to wait a few months.