Solution: Put the statement of the selected option into setTimeout, for example:
setTimeout(function() {
var selSorts = $("select[id^='" controls.selsort "']");
$.each(selSorts, function(index, sort) {
var ope = $(sort).find("option[value='" arrSort[index] "']");
if (ope.length > 0)
ope[0]. selected = true;
});
}, 1);