jquery-ui-autocomplete

JqueryUI Autocomplete prevent close on click outside

烈酒焚心 提交于 2019-12-13 01:25:48
问题 Is there a solution to prevent hidding search results after an outside click? I have a long-running ajax request and don't want to sit and wait untill it is finished. It has to work in background and close results on ESC key is pressed or on one of the results is selected, but if I click outside, the autocomplete even doesn't show the result. I tried something like this, but it doesn't work properly: ... close : function (event, ui) { if ($("ul.ui-autocomplete, .ui-widget-content").filter('

jQuery Autocomplete doesn't work in Rails 4

限于喜欢 提交于 2019-12-12 23:16:07
问题 I'm trying to integrate jQuery UI Autocomplete in my Rails 4.0 application like described in this Railscast: 102-AutoCompleteAssociationRevised. Unfortunately, the autocompletion doesn't work. I don't get any suggestions although the rendered HTML looks fine: <input id="plan_part_name" type="text" name="plan[part_name]" data-autocomplete-source="["foo","food","foobar"]"></input> I also deactivated Turbolinks, but nothing changed... In my Gemfile I included gem 'jquery-ui-rails' and my

Issue with custom properties in jQuery UI Autocomplete

无人久伴 提交于 2019-12-12 14:48:17
问题 I'm running into an issue with custom properties while using jQuery UI's autocomplete functionality. For some strange reason, the autocomplete function will not allow me to use the make or id attribute for ui.item.make or ui.item.id , but is working when it is set to ui.item.label . Here is JSFiddle with an example of the issue I am encountering. Here is another example of where autocomplete is working, but the difference is only the label property. Any information why using a custom property

Jquery UI Autocomplete doesn't allow options to be selected with mouse anymore

余生颓废 提交于 2019-12-12 11:07:24
问题 I recently updated jquery ui and its autocomplete plugin - however in the newer version it won't let me select the options with a mouse click and I have to use the up and down arrows. How do I re-enable selection via mouse click? Btw the new version is 1.9.1, old version was 1.8.2 回答1: In my case the mouse selection capability was disabled by an outdated third party jQuery plugin. This thread gave me an idea of what might be wrong: http://forum.jquery.com/topic/autocomplete-click-to-select

How to prevent update of input element when an item is selected in a jQueryUI autocomplete list?

自闭症网瘾萝莉.ら 提交于 2019-12-12 11:05:41
问题 I have the following jQueryUI autocomplete $('#clientSearch').autocomplete({ source: function (request, response) { var url = window.apiUrl + '/clients?searchText=' + request.term; var request = $.ajax({ url: url, type: 'GET', dataType: "json", cache: false, contentType: 'application/json; charset=utf-8' }); request.done(function (clientList) { response($.map(clientList, function (client) { return { label: client.lastName + ', ' + client.firstInitial + '. ' + client.sex + '/' + client.age,

How to reuse jquery-ui-autocomplete cached results when appending search term?

陌路散爱 提交于 2019-12-12 10:14:01
问题 I have the following JS method to bind the jQuery UI autocomplete widget to a search text box. Everything works fine, including caching, except that I make unnecessary server calls when appending my search term because I don't reuse the just-retrieved results. For example, searching for "ab" fetches some results from the server. Typing "c" after "ab" in the search box fetches "abc" results from the server, instead of reusing the cached "ab" results and omitting ones that don't match "abc". I

jQuery UI Autocomplete autoFocus not working

爱⌒轻易说出口 提交于 2019-12-12 09:38:10
问题 I am using jQuery UI autocomplete and trying to implement the autoFocus option. The documentation states the following: If set to true the first item will be automatically focused. I created a basic example and cannot get to work. I must be missing something obvious. See here: http://jsfiddle.net/9bQJX/ $("#autocomplete").autocomplete({ source: [ "ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", "Groovy", "Haskell", "Java",

jQuery autocomplete shows value instead of label

为君一笑 提交于 2019-12-12 08:59:04
问题 I am using jQuery-ui autocomplete. Here is how i use it <form action="go.php" method="post"> <input id="txt" type="text" /> </form> <script> $('#txt').autocomplete({ source: [{'label': 'milan', 'value': '1'}, {'label': 'minos', 'value': '2'}] }) </script> When i type 'mi', milan and minos shows up.No problem with that. However when i focus on them with down key value of #txt changes to 1 (value for milan) instead of milan . How can i show milan when i focus on it. Thanks 回答1: Because the

Can't change style to jQuery:s autocomplete element

孤街醉人 提交于 2019-12-12 03:33:45
问题 I've been trying to change the background color of the focused item in jQuerys autocomplete box, but is was harder than I thought. My mission is to change the blue color to something else. Is that possible? It's not the hover color. That one I already manage to change. No it's the color that displays when you use the keyboard to change focused item. Here's my fiddle: https://jsfiddle.net/18b15bw1 I've used the exact code from the example that jQuery provides: http://jqueryui.com/autocomplete/

JQuery UI Autocomplete Search Results do not display

大憨熊 提交于 2019-12-12 03:20:02
问题 arrayI am getting no search results from my mysql database using php. PHP Code: require_once "connectmysql.php"; $belongsto=$current_user->businessname; $q = trim(strip_tags($_GET["term"])); if (!$q) return; $sql = "select clientname as value from zb_clients where clientname LIKE '%".$q."%' AND belongsto='".$belongsto."'"; $result = mysql_query($sql); while($row = mysql_fetch_array($result,MYSQL_ASSOC)) { $row['value']=htmlentities(stripslashes($row['value'])); $row_set[] = $row; } echo json