Disable Combo Option, But Enable Value Set

Hi, by referring this snippet:

https://snippet.webix.com/o0qcz4rv

Would it be possible for us to stop user select Q3, but allowed us to set the Q3 by loading the value from DB if it set at other place? Or is there any better idea to achieve this? Basically Q3 is one of the option, but is not available to select from this screen

@laicp
check this
https://snippet.webix.com/ejdu2hv3

Hi @intregal … The combo is still not show O3 … Even I put

$$("$combo1").setValue(3);

at last line.

Would it be possible for us to stop user select Q3
you explicitly block selection of disabled item.

but allowed us to set the Q3 by loading the value from DB if it set at other place?
you can set it in onChange handler

expected result is not clear

Hi @intregal … Sorry for unclear expected result. What I am looking for is:

  1. User cannot select ‘disabled’ item from drop down, but
  2. We able to load the option and show it, e.g. O3 in the snippet. That why I try to put $$("$combo1").setValue(3);

Thanks.

in this case try combo.$setValue()
be aware that onChange will not be triggered.
if you need to process onChange (usually required in form) then use some flags to check if value is set by user.
https://snippet.webix.com/s2tlpiac

Hi @intregal … Thanks for that, use a flag and it is work in my usecase.