Cursor focus problem in onBlur event in dhtmlXCombo 3.5

Hello,
Earlier i was using Dhtmlx 2.5 pro edition in my application.After that i upgraded the version to 3.5.

In my application I have object of dhtmlXCombo as follows.

var combo =new dhtmlXCombo(“combo_zone2”,“alfa2”,250);
combo.attachEvent(“onBlur”,onBlurFunc);
function onBlurFunc(){
combo.clearAll();
combo.addOption([
[“a”,“option A”],
]);
combo.selectOption(0, true, true);
return true;
}

selectOption(0,true,true); is working fine in 2.5 version.

But there is some problem is 3.5 version with this code,the problem is cursor focus is always coming to this combo box if value exists in the combo box even if we click any other fields.

To resolve this cursor focus problem I am doing like selectOption(0,null,false); and now it’s fine.Don’t know exactly how it is working, but it’s working (need explanation).

Is there any problem in onBlur event in 3.5 version.?

Hello
Can’t reproduce your issue locally.
Could you provide us completed demo to check it?
docs.dhtmlx.com/doku.php?id=othe … leted_demo

About onBlur: there wasn’t any issues.

Hello,

For demo purpose i am using the same example which is available on the site

[u]http://www.dhtmlx.com/docs/products/dhtmlxCombo/samples/05_events/01_combo_events.html[/u]

but i added the following code in 01_combo_events.html

  1. Added one input box
  2. Added the following code in the onBlurFunc()
    combo.clearAll();
    combo.addOption([
    [“a”,“option A”],
    ]);
    combo.selectOption(0, true, true);

Test Scenario

  1. If there is no value selected in the combo box i am able to enter values in the text box.But as soon as i select anything in the combo box i am not able to write anything into the text box,because the cursor focus is always going to combo box.

I attached the code.But if u want to do demo u can add point number 1 and 2 in 01_combo_events.html

Now the problem is resolving if instead of selectOption(0, true, true); i put selectOption(0, null, false);,but i don’t know what is the signification of this code.

Thanks for the help.
dhtmlxComboSample.rar (255 KB)

Hello
You can use
combo.selectOption(0, true, false);
But it is not good approach.

Try to use
combo.setComboValue(“option A”);

Hello,

combo.setComboValue(“option A”); is working fine.

But my doubt is using setComboValue(“option A”); instead of selectOption(0, true, true); will make any difference or not.What are the parameter significance of selectOption() method.

Thanks & Regards.

Method selectOption sets focus to combo’s input. Method setComboValue - not.