Alibabacloud.com offers a wide variety of articles about jquery autocomplete function, easily find your jquery autocomplete function information here online.
1, the main properties of AutoComplete:Source: Three types are supported for specifying the data source in the smart hint drop-down box. Array , which is mainly used for localization data supply, supports two formats: string array ["Choice1", "Choice2"] and a JSON-formatted array of label and value attributes [{label: "Choice1", Value: "Value1"},.. . ]string, the remote address link for the AJAX request, returns an array or JSON format string. function
Previously, the auto-completion function for storing data using XML is similar to the idea in this article.
Let us implement AutoComplete feature in spring MVC application using jquery. autoComplete is a feature you "ll see in almost all good web apps. it allows user to select proper values from a list of items. adding
be searched in the foo cache. default: false
* Multiple (Boolean ):
Whether multiple values can be input. That is, multiple AutoComplete values can be used to input multiple values. Default: false
* Multipleseparator (string ):
If multiple characters are selected, they are used to separate the selected characters. Default :","
* Scroll (Boolean ):
Whether to use Scroll display when the result set is larger than the default height default:
I recently started learning jquery and want to automatically display results similar to Google search. So I chose to use the jquery AutoComplete plug-in.
Download the required files, jquery.autocomplete.jsand jquery.autocomplete.css.
Since the data obtained by the control can be obtained through the array and URL methods, I wrote two simple examples to test i
1, autocomplete get background dataFirst introduce the CSS and JS file, and the corresponding HTML code is as follows:Linkhref=".. /css/jquery-ui.css "rel= "stylesheet" />Scripttype= "Text/javascript"src=".. /js/jquery-1.9.1.min.js " >Script>Scripttype= "Text/javascript"src=".. /js/jquery-ui.js " >Script> label for= "
Write in frontAutoComplete is a plugin in jQueryUI.The effect and description can be accessed here, acting like an automatic hint when searching:I believe that the use of jquery AutoComplete Auto-complete function of the students have a lot, but often we correspond to the needs of different, and some just for the sake of easy, knock two words there is a bunch of
of replication.
In this way, it is displayed successfully. Of course, you must note that you need to modify the officially downloaded documents. Because official documents do not support Chinese prompts.
Specific modification method:
In the downloaded jquery source code, line 92nd of jquery. autocomplete. js replaces "keydown" with "keyup". Although Chinese
Recently, a bootstrap modal window (popup layer) was used in an ASP. NET MVC5 project to let the user fill in the content, and one of the edit boxes provided the AutoComplete feature, implemented with the jquery UI autocomplete.Because I am the Web front-end small white, encountered a problem for a long time did not solve it, so special simple record for later review.Problem: When the modal window is not us
automatically match the entered Chinese in firefox in a timely manner, however, the important event mechanisms such as carriage return and tab in the original plug-in are damaged. For example, if your input is in a form, press enter to directly submit the form from the original input to input. This is not what we want.
My method principle is to add an event that the original plug-in triggers the query, that is, when the character in the input column changes, re-query (call its internal onChange
automatically match the entered Chinese in firefox in a timely manner, however, the important event mechanisms such as carriage return and tab in the original plug-in are damaged. For example, if your input is in a form, press enter to directly submit the form from the original input to input. This is not what we want.My method principle is to add an event that the original plug-in triggers the query, that is, when the character in the input column changes, re-query (call its internal onChange
The jQuery plug-in Autocomplete does not support multiple Chinese characters. jqueryautocompleteIn front-end web development, when it comes to selection, Autocomplete is a very common plug-in, but this plug-in has some bugs when it comes to Chinese.This plug-in works well every time a text is entered. When multiple text is entered at a time, it cannot be used for
= " Zoyobar. Shared. Panzer. Web. jqueryui " Tagprefix = " Je " %>
In addition to namespaces, you also need to referenceJqueryuiTo download the script and style of the ResourceDownload jqueryelement. dllThe compressed package downloaded in this section contains a custom StyleJqueryui, If you need a more simplified style, you can download in http://jqueryui.com/download:
Link Type = "Text/CSS" REL = "Stylesheet" Href = "[Style path]/jquer
Files installed/required for introductionHere is my relative path, the reader to use their own corresponding correct path
elements that use plug-ins
OK, the following mainly from two aspects of the change plugin use: Local data, Ajax dynamic access to dataLocal datavar countries = [{value: ' American ', data: ' Us '},{value: ' Chinese ', Data: ' ZH-CN '},// ...{value: ' 中文版 ', data: ' En '}];$ (' #autocomplete ').
function to define the Source property:1 2 3 4 5 6 7 8 9Ten Wuyi Classification supportThis example provides a simple extension of the AutoComplete component that implements a custom Custom.catcomplete UI component to support AutoComplete classification support. Custom components are interesting to see in the jquery w
Automatic completion, provided that the Jquery-ui CSS and JS must be introduced, otherwise it will not be completed automatically.html lang="en">head> meta charset="Utf-8"> title>JQuery UI Autocomplete-default functionalitytitle> link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/ Smoothness/jquery-ui.cs
In the past, we developed ajax, which is used for custom development like google's Automatic completion function. Now jquery is much more convenient, and he provided us with jQuery Autocomplete Automatic completion plug-in code, let's take a look at the actual application of this Code.
In the past, we developed ajax, w
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.