I have a select widget from panel that includes different values. Depending on these values I want to make a panel slider visible.
The select widget includes the values “A”, “B” and “C”.
If I select “A” or “C” I want to make an IntSlider visible.
If i select “B” I want to see a DatetimeSlider.
It doesn’t work to add the disabled-parameter of the sliders to the function and enable the sliders due to the selection by changing the disabled-parameter. But I don’t know why this doesn’t work.
How can i solve this in a function?
Good to know: I’m working on a Jupyter Notebook environment.
A code example would be really helpful, because what you say should be certainly possible but without aminimal working example its difficult to help you
sel = pn.widgets.Select(value="A", options=["A","B","C"])
int_slid = pn.widgets.IntSlider(value=0, start=0, end=10, visible=True)
date_slid = pn.widgets.DateSlider(name='Date Slider', start=dt.datetime(2019, 1, 1), end=dt.datetime(2019, 6, 1), value=dt.datetime(2019, 2, 8), visible=False)
date_slid.visible = selection == "B"
int_slid.visible = selection != "B"
pn.Column(sel, int_slid, date_slid)