EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Aod47 on February 26, 2017, 12:52:22 AM



Title: combobox onChange, onSelect doesn't fire when select old value
Post by: Aod47 on February 26, 2017, 12:52:22 AM
I have combobox that when user select item list will open relative Window.
But if select the same item list. onChange or onSelect doesn't fire event.

Code:
<select class="easyui-combobox" id="mr_field" name="mr_field" style="width:240px;" data-options="
                                                onLoadSuccess : function(){$(this).combobox('setValue','');},
                                                onChange: function(newValue,oldValue){onChangeField(newValue);}
                                                ">
                                                <option value="v">Vehicles</option>
                                                <option value="d">Drivers</option>
                                            </select>

   <script type="text/javascript">
        function onChangeField(newvalue) {
            switch (newvalue) {
                case 'v':
                    $('#MR_WindowVehicles').window('open');
                    break
                case 'd':
                    $('#MR_WindowDrivers').window('open');
                    break;
            }       
        }

   </script>

Could you please suggest?


Title: Re: combobox onChange, onSelect doesn't fire when select old value
Post by: jarry on February 26, 2017, 05:06:32 PM
If you want to trigger something when clicking on a row, no matter it is selected or not, please use the 'onClick' event instead.