I am porting my application to twitter-bootstrap and I would like to replace jquery-ui autocomplete with typeahead.js.
It would be better to use the function built into twitter-bootstrap, but I'm fine with an additional plugin for plugins if necessary.
My problem is that I have problems reproducing the current behavior, especially with the lack of results.
How would you do something like this?
$("#search").autocomplete({ source : myUrl, delay : 100, minLength : 2, select : function(event, ui) { // do whatever i want with the selected item }, response : function(event, ui) { if (ui.content.length === 0) { ui.content.push({ label : "No result", value : customValue }); } } });
Basically, if there is no result, I want to display a custom message in the component.
Thanks!
Arnaud gourlay
source share