jquery - Twitter Bootstrap Typeahead doesn't load ajax data -



jquery - Twitter Bootstrap Typeahead doesn't load ajax data -

i have next code in place initialize typeahead using version 2.3.0:

jquery('#search_terms').typeahead({ source: function(query, process) { homecoming jquery.ajax({ url: '/api/path', type: 'get', data: {q: query}, datatype: 'json', success: function (json) { homecoming process(json.suggestion); } }); } });

i've verified typeahead works substituting static data. i've seen json.suggestion evaluates single word expected. ajax response looks this:

{"suggestion":"word"}

however, bootstrap refuses load response typeahead. missing? admit i'm having problem finding detailed documentation of bootstrap typeahead via ajax other here on so.

thanks in advance.

we found bootstrap typeahead second-guessing our ajax info own matching filter. forcing match true resolved issue:

jquery('#search_terms').typeahead({ source: function(query, process) { jquery.ajax({ url: 'api/path', type: 'get', data: {q: query}, datatype: 'json', success: function (json) { process([json.suggestion]); } }); }, matcher: function (param) {return true} });

jquery twitter-bootstrap bootstrap-typeahead

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -