I want to order my combo when the user close it, but when you select an option this will close the combo.
Actually I’m using mycombo.openSelect(); but the onClose event will trigger and I don’t want to.
Here is the code:
mycombo.attachEvent("onSelectionChange", function(){
if (mycombo.getSelectedValue() != null){
var id = mycombo.getSelectedIndex()
mycombo.unSelectOption();
//console.log(cont);
mycombo.setChecked(id, !mycombo.isChecked(id));
var cont=mycombo.getChecked().length
mycombo.setComboText(window.lang.translate("Selected") + " " + cont + " " + window.lang.translate("device"));
mycombo.openSelect();
}
return true;
});
mycombo.attachEvent("onClose", function(){
mycombo.sort(function(a,b){
return orderCombo(a,b);
});
});