annotate jquery-ui/development-bundle/docs/autocomplete.html @ 0:b2e4605f20b2

beta version
author dwinter
date Thu, 30 Jun 2011 09:07:49 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
1
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
2 <ul class="UIAPIPlugin-toc">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
3 <li><a href="#overview">Overview</a></li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
4 <li><a href="#options">Options</a></li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
5 <li><a href="#events">Events</a></li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
6 <li><a href="#methods">Methods</a></li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
7 <li><a href="#theming">Theming</a></li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
8 </ul>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
9 <div class="UIAPIPlugin">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
10 <h1>jQuery UI Autocomplete</h1>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
11 <div id="overview">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
12 <h2 class="top-header">Overview</h2>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
13 <div id="overview-main">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
14 <p>Autocomplete, when added to an input field, enables users to quickly find and select from a pre-populated list of values as they type, leveraging searching and filtering.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
15 <p>By giving an Autocomplete field focus or entering something into it, the plugin starts searching for entries that match and displays a list of values to choose from. By entering more characters, the user can filter down the list to better matches.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
16 <p>This can be used to enter previous selected values, for example you could use Autocomplete for entering tags, to complete an address, you could enter a city name and get the zip code, or maybe enter email addresses from an address book.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
17 <p>You can pull data in from a local and/or a remote source: Local is good for small data sets (like an address book with 50 entries), remote is necessary for big data sets, like a database with hundreds or millions of entries to select from.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
18 <p>Autocomplete can be customized to work with various data sources, by just specifying the source option. A data source can be:</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
19 <ul>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
20 <li>an Array with local data</li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
21 <li>a String, specifying a URL</li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
22 <li>a Callback</li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
23 </ul>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
24 <p>The local data can be a simple Array of Strings, or it contains Objects for each item in the array, with either a label or value property or both. The label property is displayed in the suggestion menu. The value will be inserted into the input element after the user selected something from the menu. If just one property is specified, it will be used for both, eg. if you provide only value-properties, the value will also be used as the label.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
25 <p>When a String is used, the Autocomplete plugin expects that string to point to a URL resource that will return JSON data. It can be on the same host or on a different one (must provide JSONP). The request parameter "term" gets added to that URL. The data itself can be in the same format as the local data described above.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
26 <p>The third variation, the callback, provides the most flexibility, and can be used to connect any data source to Autocomplete. The callback gets two arguments:</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
27 <ul>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
28 <li>A request object, with a single property called "term", which refers to the value currently in the text input. For example, when the user entered "new yo" in a city field, the Autocomplete term will equal "new yo".</li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
29 <li>A response callback, which expects a single argument to contain the data to suggest to the user. This data should be filtered based on the provided term, and can be in any of the formats described above for simple local data (String-Array or Object-Array with label/value/both properties). It's important when providing a custom source callback to handle errors during the request. You must always call the response callback even if you encounter an error. This ensures that the widget always has the correct state.</li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
30 </ul>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
31 <p>The label is always treated as text, if you want the label to be treated as html you can use <a href="https://github.com/scottgonzalez/jquery-ui-extensions/blob/master/autocomplete/jquery.ui.autocomplete.html.js" class="external text" title="https://github.com/scottgonzalez/jquery-ui-extensions/blob/master/autocomplete/jquery.ui.autocomplete.html.js">Scott González' html extension</a>. The demos all focus on different variations of the source-option - look for the one that matches your use case, and take a look at the code.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
32 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
33 <div id="overview-dependencies">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
34 <h3>Dependencies</h3>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
35 <ul>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
36 <li>UI Core</li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
37 <li>UI Widget</li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
38 <li>UI Position</li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
39 </ul>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
40 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
41 <div id="overview-example">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
42 <h3>Example</h3>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
43 <div id="overview-example" class="example">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
44 <ul><li><a href="#demo"><span>Demo</span></a></li><li><a href="#source"><span>View Source</span></a></li></ul>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
45 <p><div id="demo" class="tabs-container" rel="300">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
46 A simple jQuery UI Autocomplete.<br />
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
47 </p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
48 <pre>$(&quot;input#autocomplete&quot;).autocomplete({
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
49 source: [&quot;c++&quot;, &quot;java&quot;, &quot;php&quot;, &quot;coldfusion&quot;, &quot;javascript&quot;, &quot;asp&quot;, &quot;ruby&quot;]
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
50 });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
51 </pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
52 <p></div><div id="source" class="tabs-container">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
53 </p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
54 <pre>&lt;!DOCTYPE html&gt;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
55 &lt;html&gt;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
56 &lt;head&gt;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
57 &lt;link href=&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;/&gt;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
58 &lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js&quot;&gt;&lt;/script&gt;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
59 &lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js&quot;&gt;&lt;/script&gt;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
60
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
61 &lt;script&gt;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
62 $(document).ready(function() {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
63 $(&quot;input#autocomplete&quot;).autocomplete({
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
64 source: [&quot;c++&quot;, &quot;java&quot;, &quot;php&quot;, &quot;coldfusion&quot;, &quot;javascript&quot;, &quot;asp&quot;, &quot;ruby&quot;]
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
65 });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
66 });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
67 &lt;/script&gt;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
68 &lt;/head&gt;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
69 &lt;body style="font-size:62.5%;"&gt;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
70
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
71 &lt;input id=&quot;autocomplete&quot; /&gt;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
72
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
73 &lt;/body&gt;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
74 &lt;/html&gt;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
75 </pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
76 <p></div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
77 </p><p></div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
78 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
79 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
80 <div id="options">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
81 <h2 class="top-header">Options</h2>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
82 <ul class="options-list">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
83
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
84 <li class="option" id="option-disabled">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
85 <div class="option-header">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
86 <h3 class="option-name"><a href="#option-disabled">disabled</a></h3>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
87 <dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
88 <dt class="option-type-label">Type:</dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
89 <dd class="option-type">Boolean</dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
90
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
91 <dt class="option-default-label">Default:</dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
92 <dd class="option-default">false</dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
93
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
94 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
95 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
96 <div class="option-description">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
97 <p>Disables (true) or enables (false) the autocomplete. Can be set when initialising (first creating) the autocomplete.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
98 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
99 <div class="option-examples">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
100 <h4>Code examples</h4>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
101 <dl class="option-examples-list">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
102
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
103 <dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
104 Initialize a autocomplete with the <code>disabled</code> option specified.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
105 </dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
106 <dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
107 <pre><code>$( ".selector" ).autocomplete({ disabled: true });</code></pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
108 </dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
109
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
110
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
111 <dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
112 Get or set the <code>disabled</code> option, after init.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
113 </dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
114 <dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
115 <pre><code>//getter
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
116 var disabled = $( ".selector" ).autocomplete( "option", "disabled" );
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
117 //setter
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
118 $( ".selector" ).autocomplete( "option", "disabled", true );</code></pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
119 </dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
120
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
121 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
122 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
123 </li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
124
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
125
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
126 <li class="option" id="option-appendTo">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
127 <div class="option-header">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
128 <h3 class="option-name"><a href="#option-appendTo">appendTo</a></h3>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
129 <dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
130 <dt class="option-type-label">Type:</dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
131 <dd class="option-type">Selector</dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
132
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
133 <dt class="option-default-label">Default:</dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
134 <dd class="option-default">"body"</dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
135
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
136 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
137 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
138 <div class="option-description">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
139 <p>Which element the menu should be appended to.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
140 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
141 <div class="option-examples">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
142 <h4>Code examples</h4>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
143 <dl class="option-examples-list">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
144
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
145 <dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
146 Initialize a autocomplete with the <code>appendTo</code> option specified.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
147 </dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
148 <dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
149 <pre><code>$( ".selector" ).autocomplete({ appendTo: "#someElem" });</code></pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
150 </dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
151
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
152
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
153 <dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
154 Get or set the <code>appendTo</code> option, after init.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
155 </dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
156 <dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
157 <pre><code>//getter
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
158 var appendTo = $( ".selector" ).autocomplete( "option", "appendTo" );
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
159 //setter
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
160 $( ".selector" ).autocomplete( "option", "appendTo", "#someElem" );</code></pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
161 </dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
162
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
163 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
164 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
165 </li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
166
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
167
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
168 <li class="option" id="option-delay">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
169 <div class="option-header">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
170 <h3 class="option-name"><a href="#option-delay">delay</a></h3>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
171 <dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
172 <dt class="option-type-label">Type:</dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
173 <dd class="option-type">Integer</dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
174
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
175 <dt class="option-default-label">Default:</dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
176 <dd class="option-default">300</dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
177
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
178 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
179 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
180 <div class="option-description">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
181 <p>The delay in milliseconds the Autocomplete waits after a keystroke to activate itself. A zero-delay makes sense for local data (more responsive), but can produce a lot of load for remote data, while being less responsive.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
182 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
183 <div class="option-examples">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
184 <h4>Code examples</h4>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
185 <dl class="option-examples-list">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
186
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
187 <dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
188 Initialize a autocomplete with the <code>delay</code> option specified.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
189 </dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
190 <dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
191 <pre><code>$( ".selector" ).autocomplete({ delay: 0 });</code></pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
192 </dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
193
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
194
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
195 <dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
196 Get or set the <code>delay</code> option, after init.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
197 </dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
198 <dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
199 <pre><code>//getter
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
200 var delay = $( ".selector" ).autocomplete( "option", "delay" );
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
201 //setter
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
202 $( ".selector" ).autocomplete( "option", "delay", 0 );</code></pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
203 </dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
204
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
205 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
206 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
207 </li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
208
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
209
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
210 <li class="option" id="option-minLength">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
211 <div class="option-header">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
212 <h3 class="option-name"><a href="#option-minLength">minLength</a></h3>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
213 <dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
214 <dt class="option-type-label">Type:</dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
215 <dd class="option-type">Integer</dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
216
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
217 <dt class="option-default-label">Default:</dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
218 <dd class="option-default">1</dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
219
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
220 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
221 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
222 <div class="option-description">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
223 <p>The minimum number of characters a user has to type before the Autocomplete activates. Zero is useful for local data with just a few items. Should be increased when there are a lot of items, where a single character would match a few thousand items.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
224 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
225 <div class="option-examples">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
226 <h4>Code examples</h4>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
227 <dl class="option-examples-list">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
228
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
229 <dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
230 Initialize a autocomplete with the <code>minLength</code> option specified.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
231 </dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
232 <dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
233 <pre><code>$( ".selector" ).autocomplete({ minLength: 0 });</code></pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
234 </dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
235
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
236
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
237 <dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
238 Get or set the <code>minLength</code> option, after init.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
239 </dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
240 <dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
241 <pre><code>//getter
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
242 var minLength = $( ".selector" ).autocomplete( "option", "minLength" );
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
243 //setter
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
244 $( ".selector" ).autocomplete( "option", "minLength", 0 );</code></pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
245 </dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
246
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
247 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
248 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
249 </li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
250
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
251
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
252 <li class="option" id="option-position">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
253 <div class="option-header">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
254 <h3 class="option-name"><a href="#option-position">position</a></h3>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
255 <dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
256 <dt class="option-type-label">Type:</dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
257 <dd class="option-type">Object</dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
258
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
259 <dt class="option-default-label">Default:</dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
260 <dd class="option-default">{ my: &quot;left top&quot;, at: &quot;left bottom&quot;, collision: &quot;none&quot; }</dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
261
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
262 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
263 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
264 <div class="option-description">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
265 <p>Identifies the position of the Autocomplete widget in relation to the associated input element. The "of" option defaults to the input element, but you can specify another element to position against. You can refer to the <a href="http://docs.jquery.com/UI/Position" class="external text" title="http://docs.jquery.com/UI/Position">jQuery UI Position</a> utility for more details about the various options.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
266 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
267 <div class="option-examples">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
268 <h4>Code examples</h4>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
269 <dl class="option-examples-list">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
270
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
271 <dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
272 Initialize a autocomplete with the <code>position</code> option specified.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
273 </dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
274 <dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
275 <pre><code>$( ".selector" ).autocomplete({ position: { my : &quot;right top&quot;, at: &quot;right bottom&quot; } });</code></pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
276 </dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
277
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
278
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
279 <dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
280 Get or set the <code>position</code> option, after init.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
281 </dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
282 <dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
283 <pre><code>//getter
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
284 var position = $( ".selector" ).autocomplete( "option", "position" );
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
285 //setter
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
286 $( ".selector" ).autocomplete( "option", "position", { my : &quot;right top&quot;, at: &quot;right bottom&quot; } );</code></pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
287 </dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
288
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
289 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
290 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
291 </li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
292
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
293
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
294 <li class="option" id="option-source">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
295 <div class="option-header">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
296 <h3 class="option-name"><a href="#option-source">source</a></h3>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
297 <dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
298 <dt class="option-type-label">Type:</dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
299 <dd class="option-type">String, Array, Callback</dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
300
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
301 <dt class="option-default-label">Default:</dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
302 <dd class="option-default">none, must be specified</dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
303
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
304 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
305 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
306 <div class="option-description">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
307 <p>Defines the data to use, must be specified. See Overview section for more details, and look at the various demos.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
308 </p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
309 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
310 <div class="option-examples">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
311 <h4>Code examples</h4>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
312 <dl class="option-examples-list">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
313
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
314 <dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
315 Initialize a autocomplete with the <code>source</code> option specified.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
316 </dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
317 <dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
318 <pre><code>$( ".selector" ).autocomplete({ source: [&quot;c++&quot;, &quot;java&quot;, &quot;php&quot;, &quot;coldfusion&quot;, &quot;javascript&quot;, &quot;asp&quot;, &quot;ruby&quot;] });</code></pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
319 </dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
320
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
321
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
322 <dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
323 Get or set the <code>source</code> option, after init.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
324 </dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
325 <dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
326 <pre><code>//getter
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
327 var source = $( ".selector" ).autocomplete( "option", "source" );
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
328 //setter
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
329 $( ".selector" ).autocomplete( "option", "source", [&quot;c++&quot;, &quot;java&quot;, &quot;php&quot;, &quot;coldfusion&quot;, &quot;javascript&quot;, &quot;asp&quot;, &quot;ruby&quot;] );</code></pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
330 </dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
331
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
332 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
333 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
334 </li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
335
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
336 </ul>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
337 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
338 <div id="events">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
339 <h2 class="top-header">Events</h2>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
340 <ul class="events-list">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
341
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
342 <li class="event" id="event-create">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
343 <div class="event-header">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
344 <h3 class="event-name"><a href="#event-create">create</a></h3>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
345 <dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
346 <dt class="event-type-label">Type:</dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
347 <dd class="event-type">autocompletecreate</dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
348 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
349 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
350 <div class="event-description">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
351 <p>This event is triggered when autocomplete is created.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
352 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
353 <div class="event-examples">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
354 <h4>Code examples</h4>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
355 <dl class="event-examples-list">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
356
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
357 <dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
358 Supply a callback function to handle the <code>create</code> event as an init option.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
359 </dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
360 <dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
361 <pre><code>$( &quot;.selector&quot; ).autocomplete({
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
362 create: function(event, ui) { ... }
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
363 });</code></pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
364 </dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
365
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
366
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
367 <dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
368 Bind to the <code>create</code> event by type: <code>autocompletecreate</code>.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
369 </dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
370 <dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
371 <pre><code>$( &quot;.selector&quot; ).bind( &quot;autocompletecreate&quot;, function(event, ui) {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
372 ...
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
373 });</code></pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
374 </dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
375
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
376 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
377 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
378 </li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
379
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
380
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
381 <li class="event" id="event-search">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
382 <div class="event-header">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
383 <h3 class="event-name"><a href="#event-search">search</a></h3>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
384 <dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
385 <dt class="event-type-label">Type:</dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
386 <dd class="event-type">autocompletesearch</dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
387 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
388 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
389 <div class="event-description">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
390 <p>Before a request (source-option) is started, after minLength and delay are met. Can be canceled (return false), then no request will be started and no items suggested.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
391 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
392 <div class="event-examples">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
393 <h4>Code examples</h4>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
394 <dl class="event-examples-list">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
395
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
396 <dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
397 Supply a callback function to handle the <code>search</code> event as an init option.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
398 </dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
399 <dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
400 <pre><code>$( &quot;.selector&quot; ).autocomplete({
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
401 search: function(event, ui) { ... }
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
402 });</code></pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
403 </dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
404
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
405
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
406 <dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
407 Bind to the <code>search</code> event by type: <code>autocompletesearch</code>.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
408 </dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
409 <dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
410 <pre><code>$( &quot;.selector&quot; ).bind( &quot;autocompletesearch&quot;, function(event, ui) {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
411 ...
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
412 });</code></pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
413 </dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
414
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
415 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
416 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
417 </li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
418
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
419
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
420 <li class="event" id="event-open">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
421 <div class="event-header">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
422 <h3 class="event-name"><a href="#event-open">open</a></h3>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
423 <dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
424 <dt class="event-type-label">Type:</dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
425 <dd class="event-type">autocompleteopen</dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
426 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
427 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
428 <div class="event-description">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
429 <p>Triggered when the suggestion menu is opened.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
430 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
431 <div class="event-examples">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
432 <h4>Code examples</h4>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
433 <dl class="event-examples-list">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
434
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
435 <dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
436 Supply a callback function to handle the <code>open</code> event as an init option.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
437 </dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
438 <dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
439 <pre><code>$( &quot;.selector&quot; ).autocomplete({
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
440 open: function(event, ui) { ... }
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
441 });</code></pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
442 </dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
443
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
444
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
445 <dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
446 Bind to the <code>open</code> event by type: <code>autocompleteopen</code>.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
447 </dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
448 <dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
449 <pre><code>$( &quot;.selector&quot; ).bind( &quot;autocompleteopen&quot;, function(event, ui) {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
450 ...
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
451 });</code></pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
452 </dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
453
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
454 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
455 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
456 </li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
457
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
458
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
459 <li class="event" id="event-focus">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
460 <div class="event-header">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
461 <h3 class="event-name"><a href="#event-focus">focus</a></h3>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
462 <dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
463 <dt class="event-type-label">Type:</dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
464 <dd class="event-type">autocompletefocus</dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
465 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
466 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
467 <div class="event-description">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
468 <p>Before focus is moved to an item (not selecting), ui.item refers to the focused item. The default action of focus is to replace the text field's value with the value of the focused item, though only if the focus event was triggered by a keyboard interaction. Canceling this event prevents the value from being updated, but does not prevent the menu item from being focused.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
469 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
470 <div class="event-examples">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
471 <h4>Code examples</h4>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
472 <dl class="event-examples-list">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
473
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
474 <dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
475 Supply a callback function to handle the <code>focus</code> event as an init option.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
476 </dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
477 <dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
478 <pre><code>$( &quot;.selector&quot; ).autocomplete({
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
479 focus: function(event, ui) { ... }
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
480 });</code></pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
481 </dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
482
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
483
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
484 <dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
485 Bind to the <code>focus</code> event by type: <code>autocompletefocus</code>.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
486 </dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
487 <dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
488 <pre><code>$( &quot;.selector&quot; ).bind( &quot;autocompletefocus&quot;, function(event, ui) {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
489 ...
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
490 });</code></pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
491 </dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
492
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
493 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
494 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
495 </li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
496
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
497
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
498 <li class="event" id="event-select">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
499 <div class="event-header">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
500 <h3 class="event-name"><a href="#event-select">select</a></h3>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
501 <dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
502 <dt class="event-type-label">Type:</dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
503 <dd class="event-type">autocompleteselect</dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
504 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
505 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
506 <div class="event-description">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
507 <p>Triggered when an item is selected from the menu; ui.item refers to the selected item. The default action of select is to replace the text field's value with the value of the selected item. Canceling this event prevents the value from being updated, but does not prevent the menu from closing.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
508 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
509 <div class="event-examples">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
510 <h4>Code examples</h4>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
511 <dl class="event-examples-list">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
512
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
513 <dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
514 Supply a callback function to handle the <code>select</code> event as an init option.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
515 </dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
516 <dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
517 <pre><code>$( &quot;.selector&quot; ).autocomplete({
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
518 select: function(event, ui) { ... }
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
519 });</code></pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
520 </dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
521
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
522
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
523 <dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
524 Bind to the <code>select</code> event by type: <code>autocompleteselect</code>.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
525 </dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
526 <dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
527 <pre><code>$( &quot;.selector&quot; ).bind( &quot;autocompleteselect&quot;, function(event, ui) {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
528 ...
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
529 });</code></pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
530 </dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
531
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
532 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
533 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
534 </li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
535
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
536
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
537 <li class="event" id="event-close">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
538 <div class="event-header">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
539 <h3 class="event-name"><a href="#event-close">close</a></h3>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
540 <dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
541 <dt class="event-type-label">Type:</dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
542 <dd class="event-type">autocompleteclose</dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
543 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
544 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
545 <div class="event-description">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
546 <p>When the list is hidden - doesn't have to occur together with a change.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
547 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
548 <div class="event-examples">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
549 <h4>Code examples</h4>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
550 <dl class="event-examples-list">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
551
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
552 <dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
553 Supply a callback function to handle the <code>close</code> event as an init option.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
554 </dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
555 <dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
556 <pre><code>$( &quot;.selector&quot; ).autocomplete({
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
557 close: function(event, ui) { ... }
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
558 });</code></pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
559 </dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
560
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
561
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
562 <dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
563 Bind to the <code>close</code> event by type: <code>autocompleteclose</code>.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
564 </dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
565 <dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
566 <pre><code>$( &quot;.selector&quot; ).bind( &quot;autocompleteclose&quot;, function(event, ui) {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
567 ...
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
568 });</code></pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
569 </dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
570
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
571 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
572 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
573 </li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
574
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
575
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
576 <li class="event" id="event-change">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
577 <div class="event-header">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
578 <h3 class="event-name"><a href="#event-change">change</a></h3>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
579 <dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
580 <dt class="event-type-label">Type:</dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
581 <dd class="event-type">autocompletechange</dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
582 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
583 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
584 <div class="event-description">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
585 <p>After an item was selected; ui.item refers to the selected item. Always triggered after the close event.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
586 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
587 <div class="event-examples">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
588 <h4>Code examples</h4>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
589 <dl class="event-examples-list">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
590
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
591 <dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
592 Supply a callback function to handle the <code>change</code> event as an init option.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
593 </dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
594 <dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
595 <pre><code>$( &quot;.selector&quot; ).autocomplete({
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
596 change: function(event, ui) { ... }
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
597 });</code></pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
598 </dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
599
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
600
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
601 <dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
602 Bind to the <code>change</code> event by type: <code>autocompletechange</code>.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
603 </dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
604 <dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
605 <pre><code>$( &quot;.selector&quot; ).bind( &quot;autocompletechange&quot;, function(event, ui) {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
606 ...
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
607 });</code></pre>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
608 </dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
609
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
610 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
611 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
612 </li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
613
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
614 </ul>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
615 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
616 <div id="methods">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
617 <h2 class="top-header">Methods</h2>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
618 <ul class="methods-list">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
619
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
620 <li class="method" id="method-destroy">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
621 <div class="method-header">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
622 <h3 class="method-name"><a href="#method-destroy">destroy</a></h3>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
623 <dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
624 <dt class="method-signature-label">Signature:</dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
625 <dd class="method-signature">.autocomplete( "destroy"
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
626
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
627
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
628
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
629
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
630
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
631
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
632
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
633 )</dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
634 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
635 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
636 <div class="method-description">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
637 <p>Remove the autocomplete functionality completely. This will return the element back to its pre-init state.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
638 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
639 </li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
640
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
641
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
642 <li class="method" id="method-disable">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
643 <div class="method-header">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
644 <h3 class="method-name"><a href="#method-disable">disable</a></h3>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
645 <dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
646 <dt class="method-signature-label">Signature:</dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
647 <dd class="method-signature">.autocomplete( "disable"
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
648
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
649
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
650
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
651
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
652
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
653
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
654
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
655 )</dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
656 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
657 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
658 <div class="method-description">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
659 <p>Disable the autocomplete.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
660 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
661 </li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
662
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
663
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
664 <li class="method" id="method-enable">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
665 <div class="method-header">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
666 <h3 class="method-name"><a href="#method-enable">enable</a></h3>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
667 <dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
668 <dt class="method-signature-label">Signature:</dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
669 <dd class="method-signature">.autocomplete( "enable"
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
670
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
671
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
672
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
673
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
674
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
675
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
676
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
677 )</dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
678 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
679 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
680 <div class="method-description">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
681 <p>Enable the autocomplete.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
682 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
683 </li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
684
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
685
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
686 <li class="method" id="method-option">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
687 <div class="method-header">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
688 <h3 class="method-name"><a href="#method-option">option</a></h3>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
689 <dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
690 <dt class="method-signature-label">Signature:</dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
691 <dd class="method-signature">.autocomplete( "option"
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
692
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
693 , optionName
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
694
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
695 , <span class="optional">[</span>value<span class="optional">] </span>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
696
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
697
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
698
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
699 )</dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
700 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
701 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
702 <div class="method-description">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
703 <p>Get or set any autocomplete option. If no value is specified, will act as a getter.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
704 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
705 </li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
706
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
707
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
708 <li class="method" id="method-option">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
709 <div class="method-header">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
710 <h3 class="method-name"><a href="#method-option">option</a></h3>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
711 <dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
712 <dt class="method-signature-label">Signature:</dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
713 <dd class="method-signature">.autocomplete( "option"
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
714
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
715 , options
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
716
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
717
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
718
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
719
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
720
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
721 )</dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
722 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
723 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
724 <div class="method-description">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
725 <p>Set multiple autocomplete options at once by providing an options object.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
726 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
727 </li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
728
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
729
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
730 <li class="method" id="method-widget">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
731 <div class="method-header">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
732 <h3 class="method-name"><a href="#method-widget">widget</a></h3>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
733 <dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
734 <dt class="method-signature-label">Signature:</dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
735 <dd class="method-signature">.autocomplete( "widget"
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
736
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
737
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
738
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
739
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
740
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
741
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
742
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
743 )</dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
744 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
745 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
746 <div class="method-description">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
747 <p>Returns the .ui-autocomplete element.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
748 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
749 </li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
750
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
751
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
752 <li class="method" id="method-search">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
753 <div class="method-header">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
754 <h3 class="method-name"><a href="#method-search">search</a></h3>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
755 <dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
756 <dt class="method-signature-label">Signature:</dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
757 <dd class="method-signature">.autocomplete( "search"
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
758
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
759 , <span class="optional">[</span>value<span class="optional">] </span>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
760
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
761
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
762
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
763
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
764
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
765 )</dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
766 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
767 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
768 <div class="method-description">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
769 <p>Triggers a search event, which, when data is available, then will display the suggestions; can be used by a selectbox-like button to open the suggestions when clicked. If no value argument is specified, the current input's value is used. Can be called with an empty string and minLength: 0 to display all items.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
770 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
771 </li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
772
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
773
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
774 <li class="method" id="method-close">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
775 <div class="method-header">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
776 <h3 class="method-name"><a href="#method-close">close</a></h3>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
777 <dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
778 <dt class="method-signature-label">Signature:</dt>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
779 <dd class="method-signature">.autocomplete( "close"
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
780
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
781
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
782
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
783
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
784
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
785
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
786
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
787 )</dd>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
788 </dl>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
789 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
790 <div class="method-description">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
791 <p>Close the Autocomplete menu. Useful in combination with the search method, to close the open menu.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
792 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
793 </li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
794
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
795 </ul>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
796 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
797 <div id="theming">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
798 <h2 class="top-header">Theming</h2>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
799 <p>The jQuery UI Autocomplete plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
800 </p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
801 <p>If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.autocomplete.css stylesheet that can be modified. These classes are highlighed in bold below.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
802 </p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
803
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
804 <h3>Sample markup with jQuery UI CSS Framework classes</h3>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
805 &lt;input class=&quot;ui-autocomplete-input&quot;/&gt;<br />
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
806 &lt;ul class=&quot;ui-autocomplete ui-menu ui-widget ui-widget-content ui-corner-all&quot;&gt;<br />
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
807 &nbsp;&nbsp;&lt;li class=&quot;ui-menu-item&quot;&gt;<br />
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
808 &nbsp;&nbsp;&nbsp;&nbsp;&lt;a class=&quot;ui-corner-all&quot;&gt;item 1&lt;/a&gt;<br />
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
809 &nbsp;&nbsp;&lt;/li&gt;<br />
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
810 &nbsp;&nbsp;&lt;li class=&quot;ui-menu-item&quot;&gt;<br />
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
811 &nbsp;&nbsp;&nbsp;&nbsp;&lt;a class=&quot;ui-corner-all&quot;&gt;item 2&lt;/a&gt;<br />
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
812 &nbsp;&nbsp;&lt;/li&gt;<br />
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
813 &nbsp;&nbsp;&lt;li class=&quot;ui-menu-item&quot;&gt;<br />
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
814 &nbsp;&nbsp;&nbsp;&nbsp;&lt;a class=&quot;ui-corner-all&quot;&gt;item 3&lt;/a&gt;<br />
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
815 &nbsp;&nbsp;&lt;/li&gt;<br />
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
816 &lt;/ul&gt;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
817 <p class="theme-note">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
818 <strong>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
819 Note: This is a sample of markup generated by the autocomplete plugin, not markup you should use to create a autocomplete. The only markup needed for that is &lt;input/&gt;.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
820 </strong>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
821 </p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
822
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
823 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
824 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
825
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
826 </p><!--
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
827 Pre-expand include size: 34461 bytes
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
828 Post-expand include size: 58313 bytes
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
829 Template argument size: 31985 bytes
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
830 Maximum: 2097152 bytes
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
831 -->
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
832
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
833 <!-- Saved in parser cache with key jqdocs_docs:pcache:idhash:3766-1!1!0!!en!2 and timestamp 20110315194630 -->