Combo behaviour when `editable` is true

edited July 2017 in Technical questions

Hello,

I'm trying to use the editable option of the ui.combo but it doesn't seems to work. Everytime the component loses focus, the entered value goes away.

I can't neither get the value trough the form getValues() nor through the component itself.

See the following snippet: https://webix.com/snippet/bb807e59

The goal here is to let the user select a value from the combo, but if he wants to create a new one, he'll enter the text and click the 'plus' button. That will fire a request to the server to create this element, add it to the combo and select it.

Comments

  • +1

    I am running into this exact same problem, on Webix 6.1.5

  • Editable in the combo is prevent reset the entered value. As I can see in the snippet, the focus is lost when the button was clicked. It's expected behavior.

  • So how can I get a combo box to accept a new value and use that on form submit? The docs say 'allows adding the new value to the options list'. How does one achieve that with ui.combo?

  • @michelb
    You can use suggest box and text editor.
    Please check https://snippet.webix.com/afnpj0x9
    Here is shown a sample where you can enter a new value, get value from text input and add it to option list by a button and then, by clicking on Enter key, open an option list with a new value.

  • I don't see any editable combo box in the snippet?

  • Yes, the above solution is the best one.
    You can use combo, but then you will need to add some custom things as here: https://snippet.webix.com/66410bef

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!