Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide more granular control over editing dataframe st.data_editor #8611

Open
2 tasks done
bhaveshachhada opened this issue May 5, 2024 · 2 comments
Open
2 tasks done
Labels
feature:st.data_editor type:enhancement Requests for feature enhancements or new features

Comments

@bhaveshachhada
Copy link

Checklist

  • I have searched the existing issues for similar feature requests.
  • I added a descriptive title and summary to this issue.

Summary

Suppose a situation where I want to allow the user to insert data but not to delete any existing data or vice versa, in that case, the num_rows="dynamic" is not sufficient. The developer should have more granular control over how the data can be modified.

Why?

I had a situation where the data displayed was taken from database, in this case, I wanted to allow deleting existing rows if those are not needed anymore, but restrict making any manual inserts by typing in values directly. The insertion was to be made using st.selectbox to keep values categorical and avoid human typing mistakes. I was stuck in the situation and couldn't find a solution.

How?

The best can be done by deprecating the num_rows = Literal["fixed", "dynamic]parameter and introduce two different boolean parametersallow_insert=Falseandallow_delete=False```.

Additional Context

Can be found Here as well.

@bhaveshachhada bhaveshachhada added the type:enhancement Requests for feature enhancements or new features label May 5, 2024
Copy link

github-actions bot commented May 5, 2024

To help Streamlit prioritize this feature, react with a 👍 (thumbs up emoji) to the initial post.

Your vote helps us identify which enhancements matter most to our users.

Visits

@jrieke
Copy link
Collaborator

jrieke commented May 8, 2024

Yup, that sounds like a good idea and I think I've also heard this somewhere in the past. We don't have any concrete plan for this right now but will prioritize if it gets more upvotes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:st.data_editor type:enhancement Requests for feature enhancements or new features
Projects
None yet
Development

No branches or pull requests

3 participants