select control

Hi Alexandra,

There is a problem in the select control.
Here is my code below:
[i]dhx.ui({	view: "select",id: "id_select",value: "",
	options: [{value: "item 1",label: "item1"}, {value: "item 2",label: "item2"}],
	on: { "onchange": function(value){alert("you select " + value);	}}});[/i]

When it runs the next javescript code, the “onchange” event can’t be triggered.
//disable the select control
$$(‘id_select’).define(‘disabled’, true);
$$(‘id_select’).refresh();

//enable the select control
$$(‘id_select’).define(‘disabled’, false);
$$(‘id_select’).refresh();

Can you tell me what's wrong in my code?

Regards
Gainy

Hi,

The issue is caused by refresh() usage. Try to set “disabled” attribute directly to select element without refreshing:

$$(‘id_select’).define(‘disabled’, true);
$$(‘id_select’).getInput().setAttribute(“disabled”,true);

$$(‘id_select’).define(‘disabled’, false);
$$(‘id_select’).getInput().removeAttribute(“disabled”);

Hi Alexandra,

It works as I expected.
Alexandra, thank you very much!

Regards
Gainy

You are welcome !