s00500 / ESPUI

A simple web user interface library for ESP32 and ESP8266

Home Page:https://valencia.lbsfilm.at/midterm-presentation/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to remove an option into a select input..

nodoubtman opened this issue · comments

Hello.
How to remove an option into an select input ?

Thanks.
Marc.

Can't you just remove the Select control with ESPIU.removeControl() and then refresh the UI with jsonReload()?

Thanls for replying :)
I want to remove an option which are into the select.
I dont find any way to remove it.
Thanks.
Marc

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);

Thanks.
I will try it.
Marc.

@iangray001 thank you its works :)

Good day.
Marc.

Awesome, good stuff.