jquery-autocomplete

Jquery autocomplete styling

江枫思渺然 提交于 2019-12-03 19:30:59
问题 While styling the jQuery autocomplete plugin, I get the following HTML code hardwired to my page: <ul class="ui-autocomplete ui-menu ui-widget ui-widget-content ui-corner-all" role="listbox" aria-activedescendant="ui-active-menuitem" style="z-index: 1; top: 0px; left: 0px; display: none; "></ul> How can I disable styling from being made through HTML and keep it done via CSS? I don't think my CSS files are overwriting that style. Any help will do 回答1: jQuery autocomplete needs to set some

How to customize jquery autocomplete for displaying in a DIV

别来无恙 提交于 2019-12-03 16:31:51
I'm just wondering, I have used autocomplete plugins before but the example on jquery's website seems very simple and useful: $(function() { var availableTags = [ "ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", ]; $( "#tags" ).autocomplete({ source: availableTags }); }); <div class="demo"> <div class="ui-widget"> <label for="tags">Tags: </label> <input id="tags"> </div> </div> However, the results posted are each in input boxes. And when you click away from the results they disappear. 1) I need the results to not disappear, as

Repositioning jQuery UI Autocomplete on browser resize

杀马特。学长 韩版系。学妹 提交于 2019-12-03 14:24:48
There is an issue if you open up an autocomplete drop down and also resize your browser window the autocomplete drop down does not reposition. Highlighted in this video: http://www.youtube.com/watch?v=d7rZYH0DgWE I have looked at the documentation and cannot find a reposition method (in the jquery-ui documentation http://jqueryui.com/demos/autocomplete ) that can be called within a $(window).resize() function call. Is there an elegant soultion to this? I would suggest just closing the results on a page resize. $(window).resize(function() { $(".ui-autocomplete").css('display', 'none'); }); When

Jquery Autocomplete with Django

空扰寡人 提交于 2019-12-03 13:48:45
问题 I'm trying to make a search of some items with a jquery ui autocomple in a django app. I have looked at this question, and I'm following just like autocomplete doc. I'm not interested in plugins or something else. I got this. In views.py: def search_view(request): q = request.GET['term'] ret = [] listado = Model.objects.filter(descripcion__istartswith=q).order_by("descripcion") for l in listado: ret.append({'label':l.descripcion, 'value':l.id}) return HttpResponse(simplejson.dumps(ret),

jQuery Autocomplete order of results

杀马特。学长 韩版系。学妹 提交于 2019-12-03 12:33:51
I am using the jQuery-autocomplete plugin to get suggestions for completion of the input string using an AJAX call to a server. Also, the server takes care of returning the results in the order I would want them to appear but autocomplete shows them in a different order. How can I configure jQuery autocomplete to not reorder the output ? I don't require any kind of processing on the client's end as the data has already been ranked/sorted as required. Farhan Ahmad Simply sorting the server results before sending it to autocomplete should do it. So before you echo json_encode($return_arr); use

Jquery catching click event on jquery ui autocomplete

半城伤御伤魂 提交于 2019-12-03 11:46:55
问题 i have been trying to figure this out lately but i can't the problem is that i have an input field with type text that i need to get the current input data when the values from the autocomplete are selected. Note i am using jQuery UI autocomplete. i can catch the keyup event but when a user uses clicks on the autocomplete values. jQuery does not fire the change event handler, i tried using every event handler there is but to no avail. i think it cannot catch a DOM based manipulation of an

Autocomplete Without jQuery UI

柔情痞子 提交于 2019-12-03 08:39:59
问题 I'm using jQuery in my project and I need to implement autocomplete, but I'd like to avoid including jQuery UI widget, and hopefully use some specific external plugin. Could you please provide some examples/link? I have to query a remote JSON source that returns key-value couples. 回答1: You can use the Ajax Autocomplete for jQuery plugin And here is the full documentation Code SCRIPT <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="https://cdnjs.cloudflare.com/ajax

jQuery Autocomplete .data(“autocomplete”) is undefined

旧时模样 提交于 2019-12-03 08:14:46
问题 When I try to implement auto-complete using the code below I get an error stating: .data("autocomplete") is undefined How ever if I remove the .data() method from the end it works fine (just with out the customizable graphics that .data() provides). Can anyone tell me what's going wrong? $("input#testInput").bind("autocompleteselect", function (event, ui) { }).autocomplete({ appendTo: "#autoCompList", source: function (request, response) { $.ajax({ url: JSONP CALL URL dataType: "jsonp", data:

How to highlight input words in autocomplete jquery ui

爱⌒轻易说出口 提交于 2019-12-03 05:46:01
问题 Could you please help me in highlighting the typed words in the auto complete text box. i am already populating the autocomplete words and i need to just highlight the typed words alone.i am new to Jquery autocomplete i am getting the output as text like <Strong>Br</Strong>ijesh // seen as text and not as highlighting the Br alone. Below is the snippet $(document).ready(function () { $("#studentName").autocomplete({ source: function (request, response) { $.ajax({ type: "POST", contentType:

jQuery UI autocomplete refresh data

纵饮孤独 提交于 2019-12-03 03:36:29
I use jQuery ui autocomplete feature. var colors; $(document).ready(function(){ loadColors(); $('#empf').autocomplete(colors); } function loadColors(){ colors = new Array(getNumColor()); //in a loop save the colors to array using colors[i] = ... } function addColor(){ ... color[n] = color; } When the user enters new color it is saved to the color array. I switch to the autocomplete form but the entered data is not aviable until I refresh the page. Any ideas how to make the new color avialable for autocomplete? When you update the color, you need to also update the source that autocomplete uses