A possible solution to solve this issue is to define two functions to disable or enable the 'onSelect' event.
function disableOnSelect(f){
($(f).hasClass('combobox-f')?$(f):$(f).find('.combobox-f')).each(function(){
var opts = $(this).combobox('options');
opts.oldOnSelect = opts.onSelect;
opts.onSelect = function(){};
});
}
function enableOnSelect(f){
($(f).hasClass('combobox-f')?$(f):$(f).find('.combobox-f')).each(function(){
var opts = $(this).combobox('options');
opts.onSelect = opts.oldOnSelect;
});
}
Before calling the 'load' method, disable the 'onSelect' event.
disableOnSelect('#fm');
$('#fm').form('load',{
PdL_ID: '10'
});
After loading the combobox data successfully, enable the 'onSelect' event again.
<input class="easyui-combobox" name="PdL_ID" data-options="
valueField: 'PdL_ID',
textField: 'PdL_ID',
url: 'data.json',
onLoadSuccess: function(){
enableOnSelect(this);
},
onChange: function(value) {
console.log('onSelect is executed, flag = ' + flag);
}
">