KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am migrating my app to twitter-bootstrap and i would like to replace my jquery-ui autocomplete with typeahead.js. It would be better to use the feature embedded in twitter-bootstrap but i am ok with the extra typeahead plugin if necessary. My problem is that i have trouble reproducing the current behaviour especially with the absence of results. How would you do something like that? $("#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!
Tags (comma-separated)
Save Edits
Cancel