bootstrap-ajax-typeahead
bootstrap-ajax-typeahead copied to clipboard
When i press enter without selecting any typeahead suggetions .Textbox change to empty.
` $('#txtSearchText').typeahead({
ajax: {
url: "/Home/GetSuggestTextByQuery",
timeout: 500,
hint: true,
displayField: "title",
triggerLength: 1,
method: "get",
loadingClass: "loading-circle",
preDispatch: function (query) {
//showLoadingMask(true);
var selectval = $("#ddlSearchModelType").val();
var brands = $('#ddlSearchModelType option:selected');
if (brands.length != 1) {
selectval = "";
}
query = selectval + "!!--!!" + query;
return {
query: query
}
},
preProcess: function (data) {
///showLoadingMask(false);
if (data.success === false) {
// Hide the list, there was some error
return false;
}
// We good!
return data;
}
},
scrollBar: true
});
`