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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -