source: other-projects/tipple-android/i-greenstone-server-files/greenstone/webapps/greenstone3/interfaces/default/js/jquery-ui-1.8.15/docs/autocomplete.html@ 26899

Last change on this file since 26899 was 26899, checked in by davidb, 11 years ago

Tipple reborn after Chris's Summer of Code 2013

File size: 26.9 KB
Line 
1
2<ul class="UIAPIPlugin-toc">
3<li><a href="#overview">Overview</a></li>
4<li><a href="#options">Options</a></li>
5<li><a href="#events">Events</a></li>
6<li><a href="#methods">Methods</a></li>
7<li><a href="#theming">Theming</a></li>
8</ul>
9<div class="UIAPIPlugin">
10 <h1>jQuery UI Autocomplete</h1>
11 <div id="overview">
12 <h2 class="top-header">Overview</h2>
13 <div id="overview-main">
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>
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>
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>
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>
18<p>Autocomplete can be customized to work with various data sources, by just specifying the source option. A data source can be:</p>
19<ul>
20<li>an Array with local data</li>
21<li>a String, specifying a URL</li>
22<li>a Callback</li>
23</ul>
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>
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>
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>
27<ul>
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>
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>
30</ul>
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>
32 </div>
33 <div id="overview-dependencies">
34 <h3>Dependencies</h3>
35 <ul>
36<li>UI Core</li>
37<li>UI Widget</li>
38<li>UI Position</li>
39</ul>
40 </div>
41 <div id="overview-example">
42 <h3>Example</h3>
43 <div id="overview-example" class="example">
44<ul><li><a href="#demo"><span>Demo</span></a></li><li><a href="#source"><span>View Source</span></a></li></ul>
45<p><div id="demo" class="tabs-container" rel="300">
46A simple jQuery UI Autocomplete.<br />
47</p>
48<pre>$(&quot;input#autocomplete&quot;).autocomplete({
49 source: [&quot;c++&quot;, &quot;java&quot;, &quot;php&quot;, &quot;coldfusion&quot;, &quot;javascript&quot;, &quot;asp&quot;, &quot;ruby&quot;]
50});
51</pre>
52<p></div><div id="source" class="tabs-container">
53</p>
54<pre>&lt;!DOCTYPE html&gt;
55&lt;html&gt;
56&lt;head&gt;
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;
58 &lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js&quot;&gt;&lt;/script&gt;
59 &lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js&quot;&gt;&lt;/script&gt;
60
61 &lt;script&gt;
62 $(document).ready(function() {
63 $(&quot;input#autocomplete&quot;).autocomplete({
64 source: [&quot;c++&quot;, &quot;java&quot;, &quot;php&quot;, &quot;coldfusion&quot;, &quot;javascript&quot;, &quot;asp&quot;, &quot;ruby&quot;]
65});
66 });
67 &lt;/script&gt;
68&lt;/head&gt;
69&lt;body style="font-size:62.5%;"&gt;
70
71&lt;input id=&quot;autocomplete&quot; /&gt;
72
73&lt;/body&gt;
74&lt;/html&gt;
75</pre>
76<p></div>
77</p><p></div>
78 </div>
79 </div>
80 <div id="options">
81 <h2 class="top-header">Options</h2>
82 <ul class="options-list">
83
84<li class="option" id="option-disabled">
85 <div class="option-header">
86 <h3 class="option-name"><a href="#option-disabled">disabled</a></h3>
87 <dl>
88 <dt class="option-type-label">Type:</dt>
89 <dd class="option-type">Boolean</dd>
90
91 <dt class="option-default-label">Default:</dt>
92 <dd class="option-default">false</dd>
93
94 </dl>
95 </div>
96 <div class="option-description">
97 <p>Disables (true) or enables (false) the autocomplete. Can be set when initialising (first creating) the autocomplete.</p>
98 </div>
99 <div class="option-examples">
100 <h4>Code examples</h4>
101 <dl class="option-examples-list">
102
103<dt>
104 Initialize a autocomplete with the <code>disabled</code> option specified.
105</dt>
106<dd>
107<pre><code>$( ".selector" ).autocomplete({ disabled: true });</code></pre>
108</dd>
109
110
111<dt>
112 Get or set the <code>disabled</code> option, after init.
113</dt>
114<dd>
115<pre><code>//getter
116var disabled = $( ".selector" ).autocomplete( "option", "disabled" );
117//setter
118$( ".selector" ).autocomplete( "option", "disabled", true );</code></pre>
119</dd>
120
121 </dl>
122 </div>
123</li>
124
125
126<li class="option" id="option-appendTo">
127 <div class="option-header">
128 <h3 class="option-name"><a href="#option-appendTo">appendTo</a></h3>
129 <dl>
130 <dt class="option-type-label">Type:</dt>
131 <dd class="option-type">Selector</dd>
132
133 <dt class="option-default-label">Default:</dt>
134 <dd class="option-default">"body"</dd>
135
136 </dl>
137 </div>
138 <div class="option-description">
139 <p>Which element the menu should be appended to.</p>
140 </div>
141 <div class="option-examples">
142 <h4>Code examples</h4>
143 <dl class="option-examples-list">
144
145<dt>
146 Initialize a autocomplete with the <code>appendTo</code> option specified.
147</dt>
148<dd>
149<pre><code>$( ".selector" ).autocomplete({ appendTo: "#someElem" });</code></pre>
150</dd>
151
152
153<dt>
154 Get or set the <code>appendTo</code> option, after init.
155</dt>
156<dd>
157<pre><code>//getter
158var appendTo = $( ".selector" ).autocomplete( "option", "appendTo" );
159//setter
160$( ".selector" ).autocomplete( "option", "appendTo", "#someElem" );</code></pre>
161</dd>
162
163 </dl>
164 </div>
165</li>
166
167
168<li class="option" id="option-autoFocus">
169 <div class="option-header">
170 <h3 class="option-name"><a href="#option-autoFocus">autoFocus</a></h3>
171 <dl>
172 <dt class="option-type-label">Type:</dt>
173 <dd class="option-type">Boolean</dd>
174
175 <dt class="option-default-label">Default:</dt>
176 <dd class="option-default">false</dd>
177
178 </dl>
179 </div>
180 <div class="option-description">
181 <p>If set to true the first item will be automatically focused.</p>
182 </div>
183 <div class="option-examples">
184 <h4>Code examples</h4>
185 <dl class="option-examples-list">
186
187<dt>
188 Initialize a autocomplete with the <code>autoFocus</code> option specified.
189</dt>
190<dd>
191<pre><code>$( ".selector" ).autocomplete({ autoFocus: true });</code></pre>
192</dd>
193
194
195<dt>
196 Get or set the <code>autoFocus</code> option, after init.
197</dt>
198<dd>
199<pre><code>//getter
200var autoFocus = $( ".selector" ).autocomplete( "option", "autoFocus" );
201//setter
202$( ".selector" ).autocomplete( "option", "autoFocus", true );</code></pre>
203</dd>
204
205 </dl>
206 </div>
207</li>
208
209
210<li class="option" id="option-delay">
211 <div class="option-header">
212 <h3 class="option-name"><a href="#option-delay">delay</a></h3>
213 <dl>
214 <dt class="option-type-label">Type:</dt>
215 <dd class="option-type">Integer</dd>
216
217 <dt class="option-default-label">Default:</dt>
218 <dd class="option-default">300</dd>
219
220 </dl>
221 </div>
222 <div class="option-description">
223 <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>
224 </div>
225 <div class="option-examples">
226 <h4>Code examples</h4>
227 <dl class="option-examples-list">
228
229<dt>
230 Initialize a autocomplete with the <code>delay</code> option specified.
231</dt>
232<dd>
233<pre><code>$( ".selector" ).autocomplete({ delay: 0 });</code></pre>
234</dd>
235
236
237<dt>
238 Get or set the <code>delay</code> option, after init.
239</dt>
240<dd>
241<pre><code>//getter
242var delay = $( ".selector" ).autocomplete( "option", "delay" );
243//setter
244$( ".selector" ).autocomplete( "option", "delay", 0 );</code></pre>
245</dd>
246
247 </dl>
248 </div>
249</li>
250
251
252<li class="option" id="option-minLength">
253 <div class="option-header">
254 <h3 class="option-name"><a href="#option-minLength">minLength</a></h3>
255 <dl>
256 <dt class="option-type-label">Type:</dt>
257 <dd class="option-type">Integer</dd>
258
259 <dt class="option-default-label">Default:</dt>
260 <dd class="option-default">1</dd>
261
262 </dl>
263 </div>
264 <div class="option-description">
265 <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>
266 </div>
267 <div class="option-examples">
268 <h4>Code examples</h4>
269 <dl class="option-examples-list">
270
271<dt>
272 Initialize a autocomplete with the <code>minLength</code> option specified.
273</dt>
274<dd>
275<pre><code>$( ".selector" ).autocomplete({ minLength: 0 });</code></pre>
276</dd>
277
278
279<dt>
280 Get or set the <code>minLength</code> option, after init.
281</dt>
282<dd>
283<pre><code>//getter
284var minLength = $( ".selector" ).autocomplete( "option", "minLength" );
285//setter
286$( ".selector" ).autocomplete( "option", "minLength", 0 );</code></pre>
287</dd>
288
289 </dl>
290 </div>
291</li>
292
293
294<li class="option" id="option-position">
295 <div class="option-header">
296 <h3 class="option-name"><a href="#option-position">position</a></h3>
297 <dl>
298 <dt class="option-type-label">Type:</dt>
299 <dd class="option-type">Object</dd>
300
301 <dt class="option-default-label">Default:</dt>
302 <dd class="option-default">{ my: &quot;left top&quot;, at: &quot;left bottom&quot;, collision: &quot;none&quot; }</dd>
303
304 </dl>
305 </div>
306 <div class="option-description">
307 <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>
308 </div>
309 <div class="option-examples">
310 <h4>Code examples</h4>
311 <dl class="option-examples-list">
312
313<dt>
314 Initialize a autocomplete with the <code>position</code> option specified.
315</dt>
316<dd>
317<pre><code>$( ".selector" ).autocomplete({ position: { my : &quot;right top&quot;, at: &quot;right bottom&quot; } });</code></pre>
318</dd>
319
320
321<dt>
322 Get or set the <code>position</code> option, after init.
323</dt>
324<dd>
325<pre><code>//getter
326var position = $( ".selector" ).autocomplete( "option", "position" );
327//setter
328$( ".selector" ).autocomplete( "option", "position", { my : &quot;right top&quot;, at: &quot;right bottom&quot; } );</code></pre>
329</dd>
330
331 </dl>
332 </div>
333</li>
334
335
336<li class="option" id="option-source">
337 <div class="option-header">
338 <h3 class="option-name"><a href="#option-source">source</a></h3>
339 <dl>
340 <dt class="option-type-label">Type:</dt>
341 <dd class="option-type">String, Array, Callback</dd>
342
343 <dt class="option-default-label">Default:</dt>
344 <dd class="option-default">none, must be specified</dd>
345
346 </dl>
347 </div>
348 <div class="option-description">
349 <p>Defines the data to use, must be specified. See Overview section for more details, and look at the various demos.
350</p>
351 </div>
352 <div class="option-examples">
353 <h4>Code examples</h4>
354 <dl class="option-examples-list">
355
356<dt>
357 Initialize a autocomplete with the <code>source</code> option specified.
358</dt>
359<dd>
360<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>
361</dd>
362
363
364<dt>
365 Get or set the <code>source</code> option, after init.
366</dt>
367<dd>
368<pre><code>//getter
369var source = $( ".selector" ).autocomplete( "option", "source" );
370//setter
371$( ".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>
372</dd>
373
374 </dl>
375 </div>
376</li>
377
378 </ul>
379 </div>
380 <div id="events">
381 <h2 class="top-header">Events</h2>
382 <ul class="events-list">
383
384<li class="event" id="event-create">
385 <div class="event-header">
386 <h3 class="event-name"><a href="#event-create">create</a></h3>
387 <dl>
388 <dt class="event-type-label">Type:</dt>
389 <dd class="event-type">autocompletecreate</dd>
390 </dl>
391 </div>
392 <div class="event-description">
393 <p>This event is triggered when autocomplete is created.</p>
394 </div>
395 <div class="event-examples">
396 <h4>Code examples</h4>
397 <dl class="event-examples-list">
398
399<dt>
400 Supply a callback function to handle the <code>create</code> event as an init option.
401</dt>
402<dd>
403<pre><code>$( &quot;.selector&quot; ).autocomplete({
404 create: function(event, ui) { ... }
405});</code></pre>
406</dd>
407
408
409<dt>
410 Bind to the <code>create</code> event by type: <code>autocompletecreate</code>.
411</dt>
412<dd>
413<pre><code>$( &quot;.selector&quot; ).bind( &quot;autocompletecreate&quot;, function(event, ui) {
414 ...
415});</code></pre>
416</dd>
417
418 </dl>
419 </div>
420</li>
421
422
423<li class="event" id="event-search">
424 <div class="event-header">
425 <h3 class="event-name"><a href="#event-search">search</a></h3>
426 <dl>
427 <dt class="event-type-label">Type:</dt>
428 <dd class="event-type">autocompletesearch</dd>
429 </dl>
430 </div>
431 <div class="event-description">
432 <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>
433 </div>
434 <div class="event-examples">
435 <h4>Code examples</h4>
436 <dl class="event-examples-list">
437
438<dt>
439 Supply a callback function to handle the <code>search</code> event as an init option.
440</dt>
441<dd>
442<pre><code>$( &quot;.selector&quot; ).autocomplete({
443 search: function(event, ui) { ... }
444});</code></pre>
445</dd>
446
447
448<dt>
449 Bind to the <code>search</code> event by type: <code>autocompletesearch</code>.
450</dt>
451<dd>
452<pre><code>$( &quot;.selector&quot; ).bind( &quot;autocompletesearch&quot;, function(event, ui) {
453 ...
454});</code></pre>
455</dd>
456
457 </dl>
458 </div>
459</li>
460
461
462<li class="event" id="event-open">
463 <div class="event-header">
464 <h3 class="event-name"><a href="#event-open">open</a></h3>
465 <dl>
466 <dt class="event-type-label">Type:</dt>
467 <dd class="event-type">autocompleteopen</dd>
468 </dl>
469 </div>
470 <div class="event-description">
471 <p>Triggered when the suggestion menu is opened.</p>
472 </div>
473 <div class="event-examples">
474 <h4>Code examples</h4>
475 <dl class="event-examples-list">
476
477<dt>
478 Supply a callback function to handle the <code>open</code> event as an init option.
479</dt>
480<dd>
481<pre><code>$( &quot;.selector&quot; ).autocomplete({
482 open: function(event, ui) { ... }
483});</code></pre>
484</dd>
485
486
487<dt>
488 Bind to the <code>open</code> event by type: <code>autocompleteopen</code>.
489</dt>
490<dd>
491<pre><code>$( &quot;.selector&quot; ).bind( &quot;autocompleteopen&quot;, function(event, ui) {
492 ...
493});</code></pre>
494</dd>
495
496 </dl>
497 </div>
498</li>
499
500
501<li class="event" id="event-focus">
502 <div class="event-header">
503 <h3 class="event-name"><a href="#event-focus">focus</a></h3>
504 <dl>
505 <dt class="event-type-label">Type:</dt>
506 <dd class="event-type">autocompletefocus</dd>
507 </dl>
508 </div>
509 <div class="event-description">
510 <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>
511 </div>
512 <div class="event-examples">
513 <h4>Code examples</h4>
514 <dl class="event-examples-list">
515
516<dt>
517 Supply a callback function to handle the <code>focus</code> event as an init option.
518</dt>
519<dd>
520<pre><code>$( &quot;.selector&quot; ).autocomplete({
521 focus: function(event, ui) { ... }
522});</code></pre>
523</dd>
524
525
526<dt>
527 Bind to the <code>focus</code> event by type: <code>autocompletefocus</code>.
528</dt>
529<dd>
530<pre><code>$( &quot;.selector&quot; ).bind( &quot;autocompletefocus&quot;, function(event, ui) {
531 ...
532});</code></pre>
533</dd>
534
535 </dl>
536 </div>
537</li>
538
539
540<li class="event" id="event-select">
541 <div class="event-header">
542 <h3 class="event-name"><a href="#event-select">select</a></h3>
543 <dl>
544 <dt class="event-type-label">Type:</dt>
545 <dd class="event-type">autocompleteselect</dd>
546 </dl>
547 </div>
548 <div class="event-description">
549 <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>
550 </div>
551 <div class="event-examples">
552 <h4>Code examples</h4>
553 <dl class="event-examples-list">
554
555<dt>
556 Supply a callback function to handle the <code>select</code> event as an init option.
557</dt>
558<dd>
559<pre><code>$( &quot;.selector&quot; ).autocomplete({
560 select: function(event, ui) { ... }
561});</code></pre>
562</dd>
563
564
565<dt>
566 Bind to the <code>select</code> event by type: <code>autocompleteselect</code>.
567</dt>
568<dd>
569<pre><code>$( &quot;.selector&quot; ).bind( &quot;autocompleteselect&quot;, function(event, ui) {
570 ...
571});</code></pre>
572</dd>
573
574 </dl>
575 </div>
576</li>
577
578
579<li class="event" id="event-close">
580 <div class="event-header">
581 <h3 class="event-name"><a href="#event-close">close</a></h3>
582 <dl>
583 <dt class="event-type-label">Type:</dt>
584 <dd class="event-type">autocompleteclose</dd>
585 </dl>
586 </div>
587 <div class="event-description">
588 <p>When the list is hidden - doesn't have to occur together with a change.</p>
589 </div>
590 <div class="event-examples">
591 <h4>Code examples</h4>
592 <dl class="event-examples-list">
593
594<dt>
595 Supply a callback function to handle the <code>close</code> event as an init option.
596</dt>
597<dd>
598<pre><code>$( &quot;.selector&quot; ).autocomplete({
599 close: function(event, ui) { ... }
600});</code></pre>
601</dd>
602
603
604<dt>
605 Bind to the <code>close</code> event by type: <code>autocompleteclose</code>.
606</dt>
607<dd>
608<pre><code>$( &quot;.selector&quot; ).bind( &quot;autocompleteclose&quot;, function(event, ui) {
609 ...
610});</code></pre>
611</dd>
612
613 </dl>
614 </div>
615</li>
616
617
618<li class="event" id="event-change">
619 <div class="event-header">
620 <h3 class="event-name"><a href="#event-change">change</a></h3>
621 <dl>
622 <dt class="event-type-label">Type:</dt>
623 <dd class="event-type">autocompletechange</dd>
624 </dl>
625 </div>
626 <div class="event-description">
627 <p>Triggered when the field is blurred, if the value has changed; ui.item refers to the selected item.</p>
628 </div>
629 <div class="event-examples">
630 <h4>Code examples</h4>
631 <dl class="event-examples-list">
632
633<dt>
634 Supply a callback function to handle the <code>change</code> event as an init option.
635</dt>
636<dd>
637<pre><code>$( &quot;.selector&quot; ).autocomplete({
638 change: function(event, ui) { ... }
639});</code></pre>
640</dd>
641
642
643<dt>
644 Bind to the <code>change</code> event by type: <code>autocompletechange</code>.
645</dt>
646<dd>
647<pre><code>$( &quot;.selector&quot; ).bind( &quot;autocompletechange&quot;, function(event, ui) {
648 ...
649});</code></pre>
650</dd>
651
652 </dl>
653 </div>
654</li>
655
656 </ul>
657 </div>
658 <div id="methods">
659 <h2 class="top-header">Methods</h2>
660 <ul class="methods-list">
661
662<li class="method" id="method-destroy">
663 <div class="method-header">
664 <h3 class="method-name"><a href="#method-destroy">destroy</a></h3>
665 <dl>
666 <dt class="method-signature-label">Signature:</dt>
667 <dd class="method-signature">.autocomplete( "destroy"
668
669
670
671
672
673
674
675)</dd>
676 </dl>
677 </div>
678 <div class="method-description">
679 <p>Remove the autocomplete functionality completely. This will return the element back to its pre-init state.</p>
680 </div>
681</li>
682
683
684<li class="method" id="method-disable">
685 <div class="method-header">
686 <h3 class="method-name"><a href="#method-disable">disable</a></h3>
687 <dl>
688 <dt class="method-signature-label">Signature:</dt>
689 <dd class="method-signature">.autocomplete( "disable"
690
691
692
693
694
695
696
697)</dd>
698 </dl>
699 </div>
700 <div class="method-description">
701 <p>Disable the autocomplete.</p>
702 </div>
703</li>
704
705
706<li class="method" id="method-enable">
707 <div class="method-header">
708 <h3 class="method-name"><a href="#method-enable">enable</a></h3>
709 <dl>
710 <dt class="method-signature-label">Signature:</dt>
711 <dd class="method-signature">.autocomplete( "enable"
712
713
714
715
716
717
718
719)</dd>
720 </dl>
721 </div>
722 <div class="method-description">
723 <p>Enable the autocomplete.</p>
724 </div>
725</li>
726
727
728<li class="method" id="method-option">
729 <div class="method-header">
730 <h3 class="method-name"><a href="#method-option">option</a></h3>
731 <dl>
732 <dt class="method-signature-label">Signature:</dt>
733 <dd class="method-signature">.autocomplete( "option"
734
735, optionName
736
737, <span class="optional">[</span>value<span class="optional">] </span>
738
739
740
741)</dd>
742 </dl>
743 </div>
744 <div class="method-description">
745 <p>Get or set any autocomplete option. If no value is specified, will act as a getter.</p>
746 </div>
747</li>
748
749
750<li class="method" id="method-option">
751 <div class="method-header">
752 <h3 class="method-name"><a href="#method-option">option</a></h3>
753 <dl>
754 <dt class="method-signature-label">Signature:</dt>
755 <dd class="method-signature">.autocomplete( "option"
756
757, options
758
759
760
761
762
763)</dd>
764 </dl>
765 </div>
766 <div class="method-description">
767 <p>Set multiple autocomplete options at once by providing an options object.</p>
768 </div>
769</li>
770
771
772<li class="method" id="method-widget">
773 <div class="method-header">
774 <h3 class="method-name"><a href="#method-widget">widget</a></h3>
775 <dl>
776 <dt class="method-signature-label">Signature:</dt>
777 <dd class="method-signature">.autocomplete( "widget"
778
779
780
781
782
783
784
785)</dd>
786 </dl>
787 </div>
788 <div class="method-description">
789 <p>Returns the .ui-autocomplete element.</p>
790 </div>
791</li>
792
793
794<li class="method" id="method-search">
795 <div class="method-header">
796 <h3 class="method-name"><a href="#method-search">search</a></h3>
797 <dl>
798 <dt class="method-signature-label">Signature:</dt>
799 <dd class="method-signature">.autocomplete( "search"
800
801, <span class="optional">[</span>value<span class="optional">] </span>
802
803
804
805
806
807)</dd>
808 </dl>
809 </div>
810 <div class="method-description">
811 <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>
812 </div>
813</li>
814
815
816<li class="method" id="method-close">
817 <div class="method-header">
818 <h3 class="method-name"><a href="#method-close">close</a></h3>
819 <dl>
820 <dt class="method-signature-label">Signature:</dt>
821 <dd class="method-signature">.autocomplete( "close"
822
823
824
825
826
827
828
829)</dd>
830 </dl>
831 </div>
832 <div class="method-description">
833 <p>Close the Autocomplete menu. Useful in combination with the search method, to close the open menu.</p>
834 </div>
835</li>
836
837 </ul>
838 </div>
839 <div id="theming">
840 <h2 class="top-header">Theming</h2>
841 <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.
842</p>
843 <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.
844</p>
845
846 <h3>Sample markup with jQuery UI CSS Framework classes</h3>
847 &lt;input class=&quot;<strong>ui-autocomplete-input</strong>&quot;/&gt;<br />
848&lt;ul class=&quot;<strong>ui-autocomplete</strong> <strong>ui-menu</strong> ui-widget ui-widget-content ui-corner-all&quot;&gt;<br />
849&nbsp;&nbsp;&lt;li class=&quot;<strong>ui-menu-item</strong>&quot;&gt;<br />
850&nbsp;&nbsp;&nbsp;&nbsp;&lt;a class=&quot;ui-corner-all&quot;&gt;item 1&lt;/a&gt;<br />
851&nbsp;&nbsp;&lt;/li&gt;<br />
852&nbsp;&nbsp;&lt;li class=&quot;<strong>ui-menu-item</strong>&quot;&gt;<br />
853&nbsp;&nbsp;&nbsp;&nbsp;&lt;a class=&quot;ui-corner-all&quot;&gt;item 2&lt;/a&gt;<br />
854&nbsp;&nbsp;&lt;/li&gt;<br />
855&nbsp;&nbsp;&lt;li class=&quot;<strong>ui-menu-item</strong>&quot;&gt;<br />
856&nbsp;&nbsp;&nbsp;&nbsp;&lt;a class=&quot;ui-corner-all&quot;&gt;item 3&lt;/a&gt;<br />
857&nbsp;&nbsp;&lt;/li&gt;<br />
858&lt;/ul&gt;
859 <p class="theme-note">
860 <strong>
861 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;.
862 </strong>
863 </p>
864
865 </div>
866</div>
867
868</p><!--
869Pre-expand include size: 35954 bytes
870Post-expand include size: 60499 bytes
871Template argument size: 33522 bytes
872Maximum: 2097152 bytes
873-->
874
875<!-- Saved in parser cache with key jqdocs_docs:pcache:idhash:3766-1!1!0!!en!2 and timestamp 20110802001240 -->
Note: See TracBrowser for help on using the repository browser.