Loj Loj - 1 year ago 107
Javascript Question

How to show ui.combo popup manually?

I'm trying to open a popup of Webix combo control programmatically, but there are three issues I can't overcome.

Here's the snippet that represents them:

  • popup list spreads to the width of the form container (probably the current
    is the wrong target to open a popup)

Only on initial state (I mean the popup wasn't opened yet by user actions)

  • the initial value is ignored

  • new value can't be selected from the opened popup

Here's the code of the combo and the button:

value:"show popup",
var combo = $$("mycombo");
var list = combo.getList();
list.show( combo.$view ); // probably wrong

Unfortunately, I can't figure out what I'm doing wrong (or is it possible at all). Thanks in advance.

Loj Loj
Answer Source

Found it! list.show( combo.$view ) was really troublesome notation. In the following code

var combo = $$("mycombo"); 
var list = combo.getList();

show(combo.getInputNode()) resolves two of three problems. Still, I have no idea how to make the visual selection work initially, but for now, it's not a big deal.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download