|
Title: combobox keyHandler Post by: chrwei on March 26, 2015, 10:31:29 AM I'm having trouble extending the Combobox's keyhandler. I want that without the list dropped down that using up and down arrow keys will cycle though the list just like when it is extended. I've gotten that to work, but then the auto-complete feature stopped working.
I think what I need is that in my function I have to detect when the panel is open and then call the default key handle functions, but $.fn.combobox.defaults.keyHandler is all empty so I'm unsure of what I can do to restore the default behavior. I'm extending like: Code: keyHandler: $.extend($.fn.combobox.defaults.keyHandler, { my stuff here }Title: Re: combobox keyHandler Post by: chrwei on March 26, 2015, 02:31:50 PM more info: $.extend seems to change global, not just for that for that instance.
and I got it worked out, here's my solution: http://test.mywilsonmfg.com/test.php the first box is the default behavior, the 2nd is my additions. the comboUp and comboDown functions should work with any instance of a combobox, Title: Re: combobox keyHandler Post by: Opan Mustopah on March 26, 2015, 08:08:32 PM please add empty object, it will not override global,
Code: $.extend({},$.fn.combogrid.defaults.keyHandler,{hope it help you. Title: Re: combobox keyHandler Post by: chrwei on March 26, 2015, 08:21:17 PM ah, I see how I did that wrong now. still, needed to detect if the panel if visible and call the original to retain that behaviour.
IMO, it's a bit of a documentation gap, everything looks like the keyHandlers don't do anything, but when the panel is open they most certainly do things. |