EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: zombie86 on September 07, 2021, 06:41:28 AM



Title: Combobox onBeforeSelect
Post by: zombie86 on September 07, 2021, 06:41:28 AM
Dears,

I need help to prevent selecting an item from combobox depending on if statement

your help is highly appreciated


Title: Re: Combobox onBeforeSelect
Post by: jarry on September 07, 2021, 11:22:15 PM
Listen to the 'onChange' event and then restore the old value if some conditions meet.
Code:
$('#cc').combobox({
onChange: function(value,oldValue) {
if (...){
$(this).combobox('setValue', oldValue)
}
}
})