twitter bootstrap - Display a simple message if no matched result with autocomplete -
i'm working typeahead bootstrap 3. i'm trying put inside dropdown simple text message "no match found", used highlighter function, can't message see items if there no matched result.
function setautocomplete(){ $(".autocomplete").typeahead({ items: 12, source: function (request, response) { $.ajax({ url: $(".autocomplete").attr("data-url"), type: "post", datatype: "json", data: { query: request }, success: function (data) { console.log(data); if(data && data != "") { return response(data); } else { var result = ['no result matched']; console.log(result); return response(result); } } }); } }); }
Comments
Post a Comment