DataEditor: Conditional Categories and Inputs


I really love the new DataEditor (and Streamlit in general :heart_eyes:) but I can’t figure out how (or if) I can make inputs depend on other inputs.
In both my use cases I want an input-“possibility” to depend on an other value on a per line or per cell basis.

In my first example, I have an (interactive) boolean, per line, that is supposed to enable/disable the ability to input values (float) in a column.
I have seen in (Disable editing a single column in st.experimental_data_editor) that it is now possible to disable input for entire columns, but is there a way to do it per cell? Something hacky, like discarding the values right after input would be fine for now.

In my second example I want the possible categories in the cells of column B to depend on the selected values in column A.
Example: in column A, I select between a “solid” and a “fluid” and in column B I select materials (categories). But I want the choices in the fields of column B to depend on the selection in A, so that my users can not select e.g. “steel” as material for a “fluid”.

1 Like

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