Title: Easyui Combox Keyboard Navigation Problem Post by: Alfred on March 31, 2018, 07:12:11 AM I want to combobox to to be selectable using Up Arrow and Down Arrow Keyboard key. But I don't want it to be editable. I used the Right Arrow key to show the panel because if I use Down Arrow key, it is not possible to select an item in the combobox:
Code: <input type="text" class="easyui-combobox" name="oneCity" id="citi" I want the combobox be like the regular html select tag. The option in the regular html select tag can not be edited but it can be select using Up and Down Arrow when we highlight it. Please see this https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select (https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select). Please help. Title: Re: Easyui Combox Keyboard Navigation Problem Post by: jarry on April 01, 2018, 05:32:14 AM The code below overrides the 'down' handler to display the drop-down panel and navigate the items via the 'up' and 'down' key.
Code: $('#cc').combobox({ Title: Re: Easyui Combox Keyboard Navigation Problem Post by: Alfred on April 01, 2018, 06:11:16 AM This is very nice. Thank you.
Title: Re: Easyui Combox Keyboard Navigation Problem Post by: patana on April 25, 2020, 08:47:19 PM $('#cc').combobox({
editable: false, keyHandler: $.extend({}, $.fn.combobox.defaults.keyHandler, { down: function(e){ $(this).combobox('showPanel'); $.fn.combobox.defaults.keyHandler.down.call(this,e); } }) }); How to make it to global use with all combobox object? Title: Re: Easyui Combox Keyboard Navigation Problem Post by: jahangir on April 26, 2020, 12:51:08 AM Use this to make it global.
Code:
Title: Re: Easyui Combox Keyboard Navigation Problem Post by: patana on April 26, 2020, 01:39:10 AM Cool! Working like magic!
|