harvesthq / chosen

Deprecated - Chosen is a library for making long, unwieldy select boxes more friendly.
http://harvesthq.github.io/chosen/
Other
21.89k stars 4.12k forks source link

Feature Request - keypress event (or keydown) to allow dynamically updating list by Ajax #3092

Open vkelman opened 4 years ago

vkelman commented 4 years ago

I need to dynamically populate a list of options into chosen drop-down from a server - as user types.

Ajax part of it (jQuery requests sent to ASP.NET MVC controller) is obvious. I also understand that as soon as jQuery receives results I can repopulated underlying HTML select box and then run $("#form_field").trigger("chosen:updated");

But is there an easy and standard way of binding event handler to keypress (or keydown) event as user types? Again, I can probably find that DIV element generated by chosen and use its events, but maybe there is an easier way chosen itself exposes?

stamster commented 3 years ago

I'm also interested in this. Events in chosen are not well documented.