twitter / typeahead.js

typeahead.js is a fast and fully-featured autocomplete library
http://twitter.github.io/typeahead.js/
MIT License
16.52k stars 3.21k forks source link

How to trigger async request manually ? #1759

Closed aelfannir closed 4 years ago

aelfannir commented 5 years ago

I'am using a custom button inside typeahead's header (pager) , that replaces the suggestions, i already tried $('#MyTypeahead').typeahead('val', 'something'); , but it's a hack (stackoverflow) i found this in the typeahead.js

_onAsyncRequested: function onAsyncRequested(type, dataset, query) {
      this.eventBus.trigger('asyncrequest', query, dataset);
    },