jquery-ui-autocomplete

disable jQuery autocomplete dropdown

假装没事ソ 提交于 2019-12-01 10:28:55
问题 This is rather a simple question, but how do I disable the dropdown of the jQuery Autocomplete? When a user starts typing, I run my own function on the response callback. I don't need anything else to appear. This is what I have: $( "#search" ).autocomplete({ source: "/app/friends", minLength: 2, response: function( event, ui ) { $(".ui-menu-item").hide(); //i hoped this would work display(ui.content); } }); 回答1: According to the documentation for the plugin, there is an open event that fires

Add checkbox to auto complete -jQuery

♀尐吖头ヾ 提交于 2019-12-01 10:16:11
问题 I am working on this code and I have used jQuery UI for autocomplete. Now I need some help in adding check-boxes to it so that i can do multiple selections and it reflect on my field with comma separation. I found a plugin exactly what I want to create but I don't want to use any plugin for [my work] http://www.igniteui.com/combo/selection-and-checkboxes <script src="js/jquery-1.11.1.min.js"></script> <script src="js/jquery-ui.js"></script> <link rel="stylesheet" href="js/jquery-ui.css">

jQuery-UI Autocomplete submitting form onclick of item from dropdown list

↘锁芯ラ 提交于 2019-12-01 09:08:09
I'm using the jQueryUI autocomplete() function and I can't figure out how to have my form submit when an item is selected. I think the issue is with the select: event but I'm new with jQueryUI and can't figure out how to make this work. Here's my code which works fine otherwise: <script type="text/javascript"> $(document).ready(function() { $(function() { $( "#search_box" ).autocomplete({ source: function(request, response) { $.ajax({ url: "<?php echo site_url('autocomplete/suggestions'); ?>", data: { term: $("#search_box").val()}, dataType: "json", type: "POST", success: function(data){

Focus on a jQuery autocomplete result (not necessarily the first)

不打扰是莪最后的温柔 提交于 2019-12-01 07:33:05
I am struggling to extend jQuery autocomplete so that a particular item has focus by default. The out-of-the-box functionality works pretty well, but it's not perfect. Using the autoFocus option I can automatically focus on the first item. $( "#input" ).autocomplete({ source: "autocomplete.php", minLength: 1, autoFocus: true }); However, I would like to have more control over which item is focused. If the user types in "eng" and the relevant items that my source returns are: American English British English English Scots English I would like the third item, English , to be in focus by default

jQuery-UI Autocomplete submitting form onclick of item from dropdown list

≯℡__Kan透↙ 提交于 2019-12-01 06:02:12
问题 I'm using the jQueryUI autocomplete() function and I can't figure out how to have my form submit when an item is selected. I think the issue is with the select: event but I'm new with jQueryUI and can't figure out how to make this work. Here's my code which works fine otherwise: <script type="text/javascript"> $(document).ready(function() { $(function() { $( "#search_box" ).autocomplete({ source: function(request, response) { $.ajax({ url: "<?php echo site_url('autocomplete/suggestions'); ?>"

jQuery's Autocomplete dropdown is not showing after upgrade to jQuery UI 1.10.3

强颜欢笑 提交于 2019-12-01 04:14:20
In my Ruby on Rails app I was using jQuery UI 1.9.2 (through jquery-ui-rails ). I had an Autocomplete field in a Modal Dialog form that was populating it's dropdown suggestion box using Ajax and Json. It worked correctly, showing me the correct suggestions. I subsequently upgraded to jQuery UI 1.10.3 (using bundle update ) and now the Autocomplete dropdown suggestion box is no longer working. It shows no error in the JavaScript console. In fact it shows that the Json that is returned is correct. I have tried rewriting the autocomplete function in JS to perform the call manually (using the

Clear the cache for jquery ui autocomplete

安稳与你 提交于 2019-11-30 22:39:46
问题 I think I have read every stackoverflow and google result available on this issue and they all seem to refer to the first jquery autocomplete plugin and not the current jquery ui autocomplete. What is the method for forcing the autocomplete results to update from the data source instead of the cached list? 回答1: The jquery ui autocomplete does not do any caching. The caching is happening at the browser level. To prevent it from happening, use $.ajaxSetup . $.ajaxSetup({ cache: false }); You

JQuery Autocomplete close option when click outside

回眸只為那壹抹淺笑 提交于 2019-11-30 21:56:26
I would like to know if there's a way in JQuery Autocomplete, when is open the options if I click OUTSIDE the options box to select or click ESCAPE in the keyboard. It closes, without having to select one option. Anyone know the correct way to do it? Still thought using something to check if focus the autocomplete , if not to close it but is just an a IDEA. Thanks Just close the autocomplete when the dialog is closed: $("#dialog").dialog({ close: function() { $('#tags').autocomplete('close'); } }); See this in action: http://jsfiddle.net/william/3Yz9f/1/ . Update It depends what you mean by

jquery ui autocomplete _renderItem seems to interfere with select event

大兔子大兔子 提交于 2019-11-30 18:37:49
My select event doesn't work if I use _renderItem. If I comment out the last block of code where I call _renderItem, the select event works. When I use _renderItem, the select event doesn't fire at all. var cache = {}, lastXhr; $("#hifind-find").autocomplete({ source: function(request, response) { var term = request.term; if (term in cache) { response(cache[term]); return; } var posturl = '/hifind/jquery_ui/autocomplete/'+term; lastXhr = $.post(posturl, function(data, status, xhr) { cache[term] = data; if (xhr === lastXhr) { response(data); } }, 'json'); }, delay: 300, minLength: 1, select:

Testing JQuery autocomplete ui with cucumber

*爱你&永不变心* 提交于 2019-11-30 18:27:58
问题 I got this cucumber sceanario: When I fill in "End User" with "john" Then wait Then wait When I click "John Doe" Then show me the page Step definitions: Then /^wait$/ do sleep 2 end When /^(?:|I )click "([^"]*)"$/ do |selector| find(":contains('#{selector}')").click end It passes but it doesn't select a user."End User" equals "john" in 'show me the page'. I even can't get it to work in a javascript console. The following code does not select anything. $(":contains('John Doe')").last().trigger