Add or remove ComboBoxItems to exists ComboBox #3269
-
Hi, i'm new in react and ui5. I look for the possibility to add or remove the items to an already created combobox. Thanks in andvance |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi @romanjetich to add or remove components from the DOM you can use conditional rendering. (basic codeSandbox example can be found here)
Could you elaborate on what you mean with this? |
Beta Was this translation helpful? Give feedback.
-
Thank you for reply. Conditional Rendering is not this what i need. For example I have two combos - cb1 and cb2. And cb1 controls which data will be loaded into the cb2 via request to the server. |
Beta Was this translation helpful? Give feedback.
-
So if I understood correctly, you want to fill the second combobox depending on the response of the server, right? If that's the case you can just map the response to the If not please elaborate more on what exactly you want to achieve. |
Beta Was this translation helpful? Give feedback.
So if I understood correctly, you want to fill the second combobox depending on the response of the server, right?
E.g.:
In cb1 you select "countries" then cb2 should contain all countries from the response of the server.
If that's the case you can just map the response to the
ComboBoxItem
s. See hereIf not please elaborate more on what exactly you want to achieve.