How to remove an option into a select input..
nodoubtman opened this issue · comments
Marc Paradis commented
Hello.
How to remove an option into an select input ?
Thanks.
Marc.
Ian Gray commented
Can't you just remove the Select control with ESPIU.removeControl()
and then refresh the UI with jsonReload()
?
Marc Paradis commented
Thanls for replying :)
I want to remove an option which are into the select.
I dont find any way to remove it.
Thanks.
Marc
Ian Gray commented
I'm confused. You create a select and its options with:
auto select1 = ESPUI.addControl( ControlType::Select, "Select Title", "Initial Value", ControlColor::Alizarin, tab1, &selectExample );
auto opt1 = ESPUI.addControl( ControlType::Option, "Option1", "Opt1", ControlColor::Alizarin, select1);
auto opt2 = ESPUI.addControl( ControlType::Option, "Option2", "Opt2", ControlColor::Alizarin, select1);
so you can remove then with
ESPIU.removeControl(opt1);
Marc Paradis commented
Thanks.
I will try it.
Marc.
Marc Paradis commented
@iangray001 thank you its works :)
Good day.
Marc.
Ian Gray commented
Awesome, good stuff.