i am using autocomplete in one of my project. I want to upgrade from ui 1.8.5 to 1.10.1 . i simple include the new new libraries of jquery and jquery ui and autocomplete is not showing the result menu, it just displays the text "2 results are available" and i can navigate among the result but menu for selection is not displayed. here is the code for autocomplete.
function initLoc() {
$(".location").each(function (index) {
$(this)
.bind("keydown", function (event) {
if (event.keyCode === $.ui.keyCode.ENTER && !$(this).data("selectVisible")) {
$(this).val('');
}
})
.autocomplete({
minLength: 3,
delay: 100,
autoFocus: true,
source: function (request, response) {
var term = request.term;
if (term in cache) {
response(cache[term]);
return;
}
lastXhr = $.getJSON("/httphandlers/SearchLocationContents.ashx?city=" + city, request, function (data, status, xhr) {
cache[term] = data;
if (xhr === lastXhr) {
response(data);
}
});
},
open: function () {
$(this).data("selectVisible", true);
},
close: function () {
$(this).data("selectVisible", false);
},
search: function () { if ($.trim(this.value) == "") return false; },
select: function (event, ui) { },
change: function (event, ui) {
if (!ui.item) {
var val = $(this).data("uiItem");
if (typeof val === 'undefined') {
val = '';
}
$(this).val(val);
}
}
});
});
}
here is the image of the result.
I want to hide the text "2 results available" and menu should be displayed.
I am having a problem, ; jquery datepicker shows up again when i call setDate function , i have multiple datepickers on my page. when one datepicker value is selected i want to set the values of all other calendars that are showed up and it just hangs until i click the datepicker again, here is how i am doing it. I am using jquery 1.6.1 and jquery-ui-1.8.5
function initCalendarMulti() {
$(".calendarmulti").each(function (index) {
$(this).datepicker({
numberOfMonths: 2,
minDate: 1,
maxDate: "+1Y",
changeMonth: true,
changeYear: true,
duration: "fast",
onSelect: setValuesMulti,
regional: cul
});
});
}
function setValuesMulti(elem, inst) {
var temp;
if(segmIndex == 1) return;
for(var i = 1; i <= segmIndex; i++) {
var depSrc = $("#segment" + i + " input[id=txtDeparture" + i + "]").datepicker("getDate");
if($("#segment" + (i + 1)).hasClass("hide") == false) {
var id = "segment" + (i + 1) + " input[id=txtDeparture" + (i + 1) + "]";