widget on focus show list and remove list

kalyan

New Member
i had a widget which is a wrapper of a input and button. i want to dispaly the dropdown on both input focus and button click. It works fine on button click and input works fine only one time after that not working. Even if u select an option its not working....If u make input blur then it will work fine, until u select something or use button click.... below is my code .....any work around plz.................................\[code\] input = $("<input>") .appendTo(wrapper) .val(value) .attr("title", "") .autocomplete({ delay: 0, minLength: 0, appendTo: wrapper, source: function (request, response) { var matcher = new RegExp($.ui.autocomplete.escapeRegex(request.term), "i"); response(select.children("option").map(function () { var text = $(this).text(); if (this.value && (!request.term || matcher.test(text))) return { label: text, value: text, option: this }; })); }, .focus(function () { $(".ui-combobox").addClass("focus"); if (wasOpen) { return; } input.autocomplete("search", ""); }) .blur(function () { $(".ui-combobox").removeClass("focus"); }); // creating the anchor button $("<button></button>") .attr("tabIndex", -1) .addClass("br-r") .appendTo(wrapper) .mousedown(function () { wasOpen = input.autocomplete("widget").is(":visible"); }) .click(function () { input.focus(); if (wasOpen) { return; } input.autocomplete("search", ""); }); },\[/code\]the above is just the snippet deals with the required functionality.........
 
Back
Top