Disabling an option when using dhtmlxcombo

How can we disable an option when we use a dhtmlx combo box like we disable an option in a select box using html tag.

Hello,
try to use
combo.disable(true);

Hi,

I think that will disable the combo box… but i want to disable a particular option only…is there any solution

What do you mean by disabling?
Visual styles of option can be affected as
combo.getOption(value).render().style.color=“gray”;
so it will look as disabled, but there is no option to prevent its selection.

You can add logic to onChange event of combo as

combo.attachEvent(“onChange”,function(value){
if (some_check(value))
combo.setComboValue(""); //switch to empty value
})

Hi,

Disabling an option means the way we disable it in the following manner like for example,


      One
      <option value=“2” disabled=“disabled”>Two
      Three


Here we can disable a particular option and we can prevent the user from selecting the option which is disabled.
In the same above manner, I want to disable an option when using the dhtmlXcombo. Is this possible using the dhtmlXcombo box!

Disabling an option means the way we disable it in the following manner like for example,
Such use-case not supported by dhtmlxcombo