How to select an option in dhtmlxCombo without trigerring on

Hi,



I have a combo box with onChane event attached:



categoryCombo.attachEvent(“onChange”, doOnCategoryChange);



This let’s me do some custom processing when user selects a value from combo box.





I want to be able to programmatically select an option and not trigger the onChange event.

However, doing the following:



categoryCombo.selectOption(idx);



triggers the onChange event as well. Is there a way not to trigger onChange for programmatic option selection?



Thank you,

Stan.

By default, the selectOption method calls “onChange” event.  This call can be disabled  by the third parameter of the selectOption method (the second one enables autocomplit range):

combo.selectOption(idx,false,false);

Please beware that such call will change only text of combo, not actually selected value


There is no way to call selectOption without firing onChange event, but you can use current combo value and text by

     grid.setComboValue(value);
     grid.setComboText(text);

those methods just change related property without triggering any events.


This solution works partialy



     grid.setComboValue(value);
     grid.setComboText(text);




because it does not select the proper option in the combo.  That is if user clicks on combo the old option is still selected.



Stan.