jquery-ui-autocomplete

Display spinner with jQuery-ui autocomplete

一世执手 提交于 2019-12-03 11:04:09
问题 I've been searching all over the place and just don't see anyone doing it - Is it possible to have some kind of spinner/loader with a jQuery UI Autocomplete? (1.8) while data is being fetched? 回答1: You should be able to put a spinner image next to the field with the autocomplete and hide it initially. Then use the callback functions to hide/show it. Then use the search option to show the spinner and open to hide it: v1.8 and below $( ".selector" ).autocomplete({ search: function(event, ui) {

jquery autocomplete json and clickable link through

我的梦境 提交于 2019-12-03 09:00:13
I've been at this for a while and I'm making very slow progress mostly because my jquery skills need improvement, I am trying though :) I have this code: jQuery(function() { jQuery("input#search").autocomplete({ minLength: 2, source: function(request, response) { jQuery.post("index.php?option=com_eat&view=search&format=raw", { "'.$token.'": "1", search_string: request.term }, function(data) { response( jQuery.map( data, function( item ) { return { value: item.name, url: item.url } })); }, "json"); } }); }); The return from the post is json in the form: data.url = some_url; data.name = some

jQuery Autocomplete: Event-select

假如想象 提交于 2019-12-03 06:44:19
问题 I am trying to submit a form when an item is selected from the menu. I set class on the search form and I am using the event select for it which is found here: http://docs.jquery.com/UI/Autocomplete#event-select Now, when you select an item using the keyboard (UP and Down), it works. But if you select an item using the mouse, it gives you the value which is previously typed. Check this screenr: http://www.screenr.com/7T0s This is what I use for submitting: $("#searchform-input").autocomplete(

jQuery UI autocomplete shows value instead of label in the input field

妖精的绣舞 提交于 2019-12-03 04:34:16
A potentially simple issue with jQuery UI autocomplete is stumping me. My source is var ac = [ { label: "One Thing", value: "One-Thing" }, { label: "Two Thing", value: "Two-Thing" }, ] I am invoking the widget with $(function() { $( "#search" ).autocomplete({ source: PK.getAutocompleteSource(), focus: function( event, ui ) { $("#search").val(ui.item.label); return false; }, select: function( event, ui ) { $("#search").val(ui.item.label); PK.render(ui.item.value); } }); }); All works fine. When I type in the #search input field, the matching label shows up in the dropdown, and when I select the

JQuery autocomplete: how to force selection from list (keyboard)

你离开我真会死。 提交于 2019-12-03 04:31:07
I am using JQuery UI autocomplete. Everything works as expected, but when I cycle with the up/down keys on the keyboard, I notice that the textbox is filled with items in the list as expected, but when I reach the end of the list and hit the down arrow one more time, the original term that I typed shows up, which basically allows the user to submit that entry. My question: Is there a simple way to limit the selection to the items in the list, and remove the text in the input from the keyboard selection? eg: if I have a list that contains {'Apples (AA)', 'Oranges (AAA)', 'Carrots (A)'} , if the

jQueryUI autocomplete not working with dialog and zIndex

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 04:13:47
I ran into an interesting issue with jQueryUI autocomplete in a dialog box. My dialog HTML looks like this: <div id="copy_dialog"> <table> <tbody> <tr> <th>Title:</th> <td><input type="text" class="title" name="title"></td> </tr> <tr> <th>Number:</th> <td><input type="text" name="number"></td> </tr> </tbody> </table> </div> When I run the jQueryUI autocomplete on the above HTML, it works perfect. When I open it up using dialog $('#copy').click(function() { $('#copy_dialog').dialog({ autoOpen: true, width: 500, modal: false, zIndex: 10000000, title: 'Duplicate', buttons: { 'Cancel': function()

How to prevent duplicate with Bootstrap Tokenfield When using Jquery Ui Autocomplete

烂漫一生 提交于 2019-12-03 03:08:13
I am trying to implement Bootstrap Tokenfield with Jquery Ui autocomplete and so far i was able to do that except the fact that i am not able to prevent duplicates in the input field, so, unfortunately my user can choose the same value twice. In my search i have found that Bootstrap Tokenfield has a way of preventing duplicate . However I do not know how to apply to my code because it looks to me that it goes with Twitter typeahead and not Jquery Ui. How can i prevent duplicate with Bootstrap TokenField Using Jquery Ui autocomplete ? This is my Bootstrap TokenField code based on jquery ui

JQuery reusable autocomplete function

谁都会走 提交于 2019-12-02 22:20:25
问题 Hello fellow SO friends, I am having trouble with my syntax in adding a .data custom render to this autocomplete function. Where/how do I add: .data( "autocomplete" )._renderItem = function( ul, item ) { return $( "<li></li>" ) .data( "item.autocomplete", item ) .append( "<a>" + item.value + " | " + item.desc + "</a>" ) .appendTo( ul ); }; To this code: function Autocomplete(numberLocation,nameLocation,dscLocation,chargeLocation) { $(numberLocation).autocomplete ({ minLength: 4, source:

JQuery UI Autocomplete (1.8) scroll

回眸只為那壹抹淺笑 提交于 2019-12-02 22:12:36
i'm having troubles configuring the autocomplete module of JQuery-UI. I need that when the amount of data to select is big enough an scroll bar appears. This is what i tried: in the jquery-ui-1.8.16.css i've set this: ui.autocomplete{ max-height: 100px; overflow-y: auto; overflow-x: hidden; } *as shown in the ui-documentation example This is how i declare and autocomplete input: $("#myInput").autocomplete({ source: mySource, minLength: 0, }); I dont know why the scroll bar does not appear, any help would be appreciated. Thank you very much! You should override the css setting it in the page

jQuery UI Autocomplete DownArrow UpArrow

纵然是瞬间 提交于 2019-12-02 22:06:11
I am having some issues with jQuery Autocomplete and moving DownArrow and UpArrow ? The problem seems to be that <input id="autocomplete-input" value=""> focus: function (event, ui) { $('#autocomplete-input').val(ui.item.label); } This works great for MOUSE focus - but when I use arrowUp and arrowDown - it selects the ui.item.id over and above the ui.item.label How can I fix this so that either: the input val isn't changed at all [i.e. it keeps the users inputted term] it updates the input val with the focused val the user is on with keydown/keyup thanks Andrew Whitaker Make sure to prevent