%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/alliance/domains/sedl.alnetis.fr/public_html/js/libs/development-bundle/docs/
Upload File :
Create Path :
Current File : /home/alliance/domains/sedl.alnetis.fr/public_html/js/libs/development-bundle/docs/autocomplete.html

<!doctype html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>jQuery UI autocomplete documentation</title>

	<style>
	body {
		font-family: "Trebuchet MS", "Arial", "Helvetica", "Verdana", "sans-serif"
	}
	.gutter {
		display: none;
	}
	</style>
</head>
<body>

<script>{
		"title":
			"Autocomplete Widget",
		"excerpt":
			"Autocomplete enables users to quickly find and select from a pre-populated list of values as they type, leveraging searching and filtering.",
		"termSlugs": {
			"category": [
				"widgets"
			]
		}
	}</script><section class="quick-nav"><header><h2>QuickNav</h2></header><div class="quick-nav-section">
<h3>Options</h3>
<div><a href="#option-appendTo">appendTo</a></div>
<div><a href="#option-autoFocus">autoFocus</a></div>
<div><a href="#option-delay">delay</a></div>
<div><a href="#option-disabled">disabled</a></div>
<div><a href="#option-minLength">minLength</a></div>
<div><a href="#option-position">position</a></div>
<div><a href="#option-source">source</a></div>
</div>
<div class="quick-nav-section">
<h3>Methods</h3>
<div><a href="#method-close">close</a></div>
<div><a href="#method-destroy">destroy</a></div>
<div><a href="#method-disable">disable</a></div>
<div><a href="#method-enable">enable</a></div>
<div><a href="#method-option">option</a></div>
<div><a href="#method-search">search</a></div>
<div><a href="#method-widget">widget</a></div>
</div>
<div class="quick-nav-section">
<h3>Events</h3>
<div><a href="#event-change">change</a></div>
<div><a href="#event-close">close</a></div>
<div><a href="#event-create">create</a></div>
<div><a href="#event-focus">focus</a></div>
<div><a href="#event-open">open</a></div>
<div><a href="#event-response">response</a></div>
<div><a href="#event-search">search</a></div>
<div><a href="#event-select">select</a></div>
</div></section><article id="autocomplete1" class="entry widget"><h2 class="section-title">
<span>Autocomplete Widget</span><span class="version-details">version added: 1.8</span>
</h2>
<div class="entry-wrapper">
<p class="desc"><strong>Description: </strong>Autocomplete enables users to quickly find and select from a pre-populated list of values as they type, leveraging searching and filtering.</p>
<section id="options"><header><h2 class="underline">Options</h2></header><div id="option-appendTo" class="api-item first-item">
<h3>appendTo<span class="option-type"><strong>Type: </strong><a href="http://api.jquery.com/Types#Selector">Selector</a></span>
</h3>
<div class="default">
<strong>Default: </strong><code>"body"</code>
</div>
<div>Which element the menu should be appended to. Override this when the autocomplete is inside a <code>position: fixed</code> element. Otherwise the popup menu would still scroll with the page.</div>
</div>
<div id="option-autoFocus" class="api-item">
<h3>autoFocus<span class="option-type"><strong>Type: </strong><a href="http://api.jquery.com/Types#Boolean">Boolean</a></span>
</h3>
<div class="default">
<strong>Default: </strong><code>false</code>
</div>
<div>If set to <code>true</code> the first item will automatically be focused when the menu is shown.</div>
</div>
<div id="option-delay" class="api-item">
<h3>delay<span class="option-type"><strong>Type: </strong><a href="http://api.jquery.com/Types#Integer">Integer</a></span>
</h3>
<div class="default">
<strong>Default: </strong><code>300</code>
</div>
<div>The delay in milliseconds between when a keystroke occurs and when a search is performed. A zero-delay makes sense for local data (more responsive), but can produce a lot of load for remote data, while being less responsive.</div>
</div>
<div id="option-disabled" class="api-item">
<h3>disabled<span class="option-type"><strong>Type: </strong><a href="http://api.jquery.com/Types#Boolean">Boolean</a></span>
</h3>
<div class="default">
<strong>Default: </strong><code>false</code>
</div>
<div>Disables the autocomplete if set to <code>true</code>.</div>
</div>
<div id="option-minLength" class="api-item">
<h3>minLength<span class="option-type"><strong>Type: </strong><a href="http://api.jquery.com/Types#Integer">Integer</a></span>
</h3>
<div class="default">
<strong>Default: </strong><code>1</code>
</div>
<div>The minimum number of characters a user must type before a search is performed. Zero is useful for local data with just a few items, but a higher value should be used when a single character search could match a few thousand items.</div>
</div>
<div id="option-position" class="api-item">
<h3>position<span class="option-type"><strong>Type: </strong><a href="http://api.jquery.com/Types#Object">Object</a></span>
</h3>
<div class="default">
<strong>Default: </strong><code>{ my: "left top", at: "left bottom", collision: "none" }</code>
</div>
<div>Identifies the position of the suggestions menu in relation to the associated input element. The <code>of</code> option defaults to the input element, but you can specify another element to position against. You can refer to the <a href="/position">jQuery UI Position</a> utility for more details about the various options.</div>
</div>
<div id="option-source" class="api-item">
<h3>source<span class="option-type"><strong>Type: </strong><a href="http://api.jquery.com/Types#Array">Array</a> or <a href="http://api.jquery.com/Types#String">String</a> or <a href="http://api.jquery.com/Types/#Function">Function</a>( <a href="http://api.jquery.com/Types#Object">Object</a> request, <a href="http://api.jquery.com/Types#Function">Function</a> response( <a href="http://api.jquery.com/Types#Object">Object</a> data ) )</span>
</h3>
<div class="default">
<strong>Default: </strong><code>none; must be specified</code>
</div>
<div>
				Defines the data to use, must be specified.
				<p>Independent of the variant you use, 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">Scott González' html extension</a>. The demos all focus on different variations of the <code>source</code> option - look for one that matches your use case, and check out the code.</p>
			</div>
<strong>Multiple types supported:</strong><ul>
<li>
<strong>Array</strong>: 
					An array can be used for local data. There are two supported formats:
					<ul>
						<li>An array of strings: <code>[ "Choice1", "Choice2" ]</code>
</li>
						<li>An array of objects with <code>label</code> and <code>value</code> properties: <code>[ { label: "Choice1", value: "value1" }, ... ]</code>
</li>
					</ul>
					The label property is displayed in the suggestion menu. The value will be inserted into the input element when a user selects an item. If just one property is specified, it will be used for both, e.g., if you provide only <code>value</code> properties, the value will also be used as the label.
				</li>
<li>
<strong>String</strong>: 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 Autocomplete plugin does not filter the results, instead the request parameter <code>term</code> gets added to the URL, which the server-side script should use for filtering the results. The data itself can be in the same format as the local data described above.</li>
<li>
<strong>Function</strong>: 
					The third variation, a callback, provides the most flexibility and can be used to connect any data source to Autocomplete. The callback gets two arguments:
					<ul>
						<li>A <code>request</code> object, with a single <code>term</code> property, which refers to the value currently in the text input. For example, if the user enters <code>"new yo"</code> in a city field, the Autocomplete term will equal <code>"new yo"</code>.</li>
						<li>A <code>response</code> callback, which expects a single argument: 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. It's important when providing a custom source callback to handle errors during the request. You must always call the <code>response</code> callback even if you encounter an error. This ensures that the widget always has the correct state.</li>
					</ul>
				</li>
</ul>
</div></section><section id="methods"><header><h2 class="underline">Methods</h2></header><div id="method-close"><div class="api-item first-item">
<h3>close()</h3>
<div>Closes the Autocomplete menu. Useful in combination with the <a href="#method-search"><code>search</code></a> method, to close the open menu.</div>
</div></div>
<div id="method-destroy"><div class="api-item">
<h3>destroy()</h3>
<div>
		Removes the autocomplete functionality completely. This will return the element back to its pre-init state.
	</div>
</div></div>
<div id="method-disable"><div class="api-item">
<h3>disable()</h3>
<div>
		Disables the autocomplete.
	</div>
</div></div>
<div id="method-enable"><div class="api-item">
<h3>enable()</h3>
<div>
		Enables the autocomplete.
	</div>
</div></div>
<div id="method-option">
<div class="api-item">
<h3>option( optionName ) <span class="returns">Returns: <a class="return" href="http://api.jquery.com/Types/#Object">Object</a></span>
</h3>
<div>Gets the value currently associated with the specified <code>optionName</code>.</div>
<ul><li>
<div><strong>optionName</strong></div>
<div>Type: <a href="http://api.jquery.com/Types#String">String</a>
</div>
<div>The name of the option to get.</div>
</li></ul>
</div>
<div class="api-item">
<h3>option() <span class="returns">Returns: <a class="return" href="http://api.jquery.com/Types/#PlainObject">PlainObject</a></span>
</h3>
<div>Gets an object containing key/value pairs representing the current autocomplete options hash.</div>
</div>
<div class="api-item">
<h3>option( optionName, value )</h3>
<div>Sets the value of the autocomplete option associated with the specified <code>optionName</code>.</div>
<ul>
<li>
<div><strong>optionName</strong></div>
<div>Type: <a href="http://api.jquery.com/Types#String">String</a>
</div>
<div>The name of the option to set.</div>
</li>
<li>
<div><strong>value</strong></div>
<div>Type: <a href="http://api.jquery.com/Types#Object">Object</a>
</div>
<div>A value to set for the option.</div>
</li>
</ul>
</div>
<div class="api-item">
<h3>option( options )</h3>
<div>Sets one or more options for the autocomplete.</div>
<ul><li>
<div><strong>options</strong></div>
<div>Type: <a href="http://api.jquery.com/Types#Object">Object</a>
</div>
<div>A map of option-value pairs to set.</div>
</li></ul>
</div>
</div>
<div id="method-search"><div class="api-item">
<h3>search(  [value ] )</h3>
<div>Triggers a <a href="#event-search"><code>search</code></a> event and invokes the data source if the event is not canceled. Can be used by a selectbox-like button to open the suggestions when clicked. When invoked with no parameters, the current input's value is used. Can be called with an empty string and <code>minLength: 0</code> to display all items.</div>
<ul><li>
<div><strong>value</strong></div>
<div>Type: <a href="http://api.jquery.com/Types#String">String</a>
</div>
<div></div>
</li></ul>
</div></div>
<div id="method-widget"><div class="api-item">
<h3>widget()</h3>
<div>Returns a <code>jQuery</code> object containing the menu element. Although the menu items are constantly created and destroyed, the menu element itself is created during initialization and is constantly reused.</div>
</div></div></section><section id="events"><header><h2 class="underline">Events</h2></header><div id="event-change" class="api-item first-item">
<h3>change( event, ui )</h3>
<div>Triggered when the field is blurred, if the value has changed.</div>
<ul>
<li>
<div><strong>event</strong></div>
<div>Type: <a href="http://api.jquery.com/Types#Event">Event</a>
</div>
<div></div>
</li>
<li>
<div><strong>ui</strong></div>
<div>Type: <a href="http://api.jquery.com/Types#Object">Object</a>
</div>
<div></div>
<ul><li>
<div><strong>item</strong></div>
<div>Type: <a href="http://api.jquery.com/Types#jQuery">jQuery</a>
</div>
<div>The item selected from the menu, if any. Otherwise the property is <code>null</code>.</div>
</li></ul>
</li>
</ul>
</div>
<div id="event-close" class="api-item">
<h3>close( event, ui )</h3>
<div>Triggered when the menu is hidden. Not every <code>close</code> event will be accompanied by a <code>change</code> event.</div>
<ul>
<li>
<div><strong>event</strong></div>
<div>Type: <a href="http://api.jquery.com/Types#Event">Event</a>
</div>
<div></div>
</li>
<li>
<div><strong>ui</strong></div>
<div>Type: <a href="http://api.jquery.com/Types#Object">Object</a>
</div>
<div></div>
</li>
</ul>
</div>
<div id="event-create" class="api-item">
<h3>create( event, ui )</h3>
<div>
		Triggered when the autocomplete is created.
	</div>
<ul>
<li>
<div><strong>event</strong></div>
<div>Type: <a href="http://api.jquery.com/Types#Event">Event</a>
</div>
<div></div>
</li>
<li>
<div><strong>ui</strong></div>
<div>Type: <a href="http://api.jquery.com/Types#Object">Object</a>
</div>
<div></div>
</li>
</ul>
</div>
<div id="event-focus" class="api-item">
<h3>focus( event, ui )</h3>
<div>
				Triggered when focus is moved to an item (not selecting). The default action is to replace the text field's value with the value of the focused item, though only if the event was triggered by a keyboard interaction.
				<p>Canceling this event prevents the value from being updated, but does not prevent the menu item from being focused.</p>
			</div>
<ul>
<li>
<div><strong>event</strong></div>
<div>Type: <a href="http://api.jquery.com/Types#Event">Event</a>
</div>
<div></div>
</li>
<li>
<div><strong>ui</strong></div>
<div>Type: <a href="http://api.jquery.com/Types#Object">Object</a>
</div>
<div></div>
<ul><li>
<div><strong>item</strong></div>
<div>Type: <a href="http://api.jquery.com/Types#jQuery">jQuery</a>
</div>
<div>The focused item.</div>
</li></ul>
</li>
</ul>
</div>
<div id="event-open" class="api-item">
<h3>open( event, ui )</h3>
<div>Triggered when the suggestion menu is opened or updated.</div>
<ul>
<li>
<div><strong>event</strong></div>
<div>Type: <a href="http://api.jquery.com/Types#Event">Event</a>
</div>
<div></div>
</li>
<li>
<div><strong>ui</strong></div>
<div>Type: <a href="http://api.jquery.com/Types#Object">Object</a>
</div>
<div></div>
</li>
</ul>
</div>
<div id="event-response" class="api-item">
<h3>response( event, ui )</h3>
<div>Triggered after a search completes, before the menu is shown. Useful for local manipulation of suggestion data, where a custom <a href="#option-source"><code>source</code></a> option callback is not required. This event is always triggered when a search completes, even if the menu will not be shown because there are no results or the Autocomplete is disabled.</div>
<ul>
<li>
<div><strong>event</strong></div>
<div>Type: <a href="http://api.jquery.com/Types#Event">Event</a>
</div>
<div></div>
</li>
<li>
<div><strong>ui</strong></div>
<div>Type: <a href="http://api.jquery.com/Types#Object">Object</a>
</div>
<div></div>
<ul><li>
<div><strong>content</strong></div>
<div>Type: <a href="http://api.jquery.com/Types#Array">Array</a>
</div>
<div>Contains the response data and can be modified to change the results that will be shown. This data is already normalized, so if you modify the data, make sure to include both <code>value</code> and <code>label</code> properties for each item.</div>
</li></ul>
</li>
</ul>
</div>
<div id="event-search" class="api-item">
<h3>search( event, ui )</h3>
<div>Triggered before a search is performed, after <a href="#option-minLength"><code>minLength</code></a> and <a href="#option-delay"><code>delay</code></a> are met. If canceled, then no request will be started and no items suggested.</div>
<ul>
<li>
<div><strong>event</strong></div>
<div>Type: <a href="http://api.jquery.com/Types#Event">Event</a>
</div>
<div></div>
</li>
<li>
<div><strong>ui</strong></div>
<div>Type: <a href="http://api.jquery.com/Types#Object">Object</a>
</div>
<div></div>
</li>
</ul>
</div>
<div id="event-select" class="api-item">
<h3>select( event, ui )</h3>
<div>
				Triggered when an item is selected from the menu. The default action is to replace the text field's value with the value of the selected item.
				<p>Canceling this event prevents the value from being updated, but does not prevent the menu from closing.</p>
			</div>
<ul>
<li>
<div><strong>event</strong></div>
<div>Type: <a href="http://api.jquery.com/Types#Event">Event</a>
</div>
<div></div>
</li>
<li>
<div><strong>ui</strong></div>
<div>Type: <a href="http://api.jquery.com/Types#Object">Object</a>
</div>
<div></div>
<ul><li>
<div><strong>item</strong></div>
<div>Type: <a href="http://api.jquery.com/Types#jQuery">jQuery</a>
</div>
<div>The selected item.</div>
</li></ul>
</li>
</ul>
</div></section><div class="longdesc">
		<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>

		<p>This can be used to choose previously selected values, such as entering tags for articles or entering email addresses from an address book. Autocomplete can also be used to populate associated information, such as entering a city name and getting the zip code.</p>

		<p>You can pull data in from a local or remote source: Local is good for small data sets, e.g., an address book with 50 entries; remote is necessary for big data sets, such as a database with hundreds or millions of entries to select from. To find out more about customizing the data soure, see the documentation for the <a href="#option-source"><code>source</code></a> option.</p>

		<h3>Keyboard interaction</h3>

		<p>When the menu is open, the following key commands are available:</p>
		<ul>
			<li>UP - Move focus to the previous item. If on first item, move focus to the input. If on the input, move focus to last item.</li>
			<li>DOWN - Move focus to the next item. If on last item, move focus to the input. If on the input, move focus to the first item.</li>
			<li>ESCAPE - Close the menu.</li>
			<li>ENTER - Select the currently focused item and close the menu.</li>
			<li>TAB - Select the currently focused item, close the menu, and move focus to the next focusable element.</li>
			<li>PAGE UP/DOWN - Scroll through a page of items (based on height of menu). <em>It's generally a bad idea to display so many items that users need to page.</em>.</li>
		</ul>

		<p>When the menu is closed, the following key commands are available:</p>
		<ul>
			<li>UP/DOWN - Open the menu, if the <a href="#option-minLength"><code>minLength</code></a> has been met.</li>
		</ul>
	</div>
<h3>Additional Notes:</h3>
<div class="longdesc"><ul><li>
			This widget requires some functional CSS, otherwise it won't work. If you build a custom theme, use the widget's specific CSS file as a starting point.
		</li></ul></div>
<section class="entry-examples" id="entry-examples"><header><h2 class="underline">Example:</h2></header><div class="entry-example" id="example-0">
<h4><span class="desc">A simple jQuery UI Autocomplete</span></h4>
<div class="syntaxhighlighter  "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="gutter"><div class="line number1 index0 alt2">1</div><div class="line number2 index1 alt1">2</div><div class="line number3 index2 alt2">3</div><div class="line number4 index3 alt1">4</div><div class="line number5 index4 alt2">5</div><div class="line number6 index5 alt1">6</div><div class="line number7 index6 alt2">7</div><div class="line number8 index7 alt1">8</div><div class="line number9 index8 alt2">9</div><div class="line number10 index9 alt1">10</div><div class="line number11 index10 alt2">11</div><div class="line number12 index11 alt1">12</div><div class="line number13 index12 alt2">13</div><div class="line number14 index13 alt1">14</div><div class="line number15 index14 alt2">15</div><div class="line number16 index15 alt1">16</div><div class="line number17 index16 alt2">17</div><div class="line number18 index17 alt1">18</div><div class="line number19 index18 alt2">19</div><div class="line number20 index19 alt1">20</div><div class="line number21 index20 alt2">21</div><div class="line number22 index21 alt1">22</div></td><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">&lt;!doctype html&gt;</code></div><div class="line number2 index1 alt1"><code class="plain">&lt;</code><code class="keyword">html</code> <code class="color1">lang</code><code class="plain">=</code><code class="string">"en"</code><code class="plain">&gt;</code></div><div class="line number3 index2 alt2"><code class="plain">&lt;</code><code class="keyword">head</code><code class="plain">&gt;</code></div><div class="line number4 index3 alt1"><code class="undefined spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="plain">&lt;</code><code class="keyword">meta</code> <code class="color1">charset</code><code class="plain">=</code><code class="string">"utf-8"</code><code class="plain">&gt;</code></div><div class="line number5 index4 alt2"><code class="undefined spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="plain">&lt;</code><code class="keyword">title</code><code class="plain">&gt;autocomplete demo&lt;/</code><code class="keyword">title</code><code class="plain">&gt;</code></div><div class="line number6 index5 alt1"><code class="undefined spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="plain">&lt;</code><code class="keyword">link</code> <code class="color1">rel</code><code class="plain">=</code><code class="string">"stylesheet"</code> <code class="color1">href</code><code class="plain">=</code><code class="string">"<a href="http://code.jquery.com/ui/1.9.0-rc.1/themes/base/jquery-ui.css">http://code.jquery.com/ui/1.9.0-rc.1/themes/base/jquery-ui.css</a>"</code><code class="plain">&gt;</code></div><div class="line number7 index6 alt2"><code class="undefined spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="plain">&lt;</code><code class="keyword">script</code> <code class="color1">src</code><code class="plain">=</code><code class="string">"<a href="http://code.jquery.com/jquery-1.8.2.js">http://code.jquery.com/jquery-1.8.2.js</a>"</code><code class="plain">&gt;&lt;/</code><code class="keyword">script</code><code class="plain">&gt;</code></div><div class="line number8 index7 alt1"><code class="undefined spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="plain">&lt;</code><code class="keyword">script</code> <code class="color1">src</code><code class="plain">=</code><code class="string">"<a href="http://code.jquery.com/ui/1.9.0-rc.1/jquery-ui.js">http://code.jquery.com/ui/1.9.0-rc.1/jquery-ui.js</a>"</code><code class="plain">&gt;&lt;/</code><code class="keyword">script</code><code class="plain">&gt;</code></div><div class="line number9 index8 alt2"><code class="plain">&lt;/</code><code class="keyword">head</code><code class="plain">&gt;</code></div><div class="line number10 index9 alt1"><code class="plain">&lt;</code><code class="keyword">body</code><code class="plain">&gt;</code></div><div class="line number11 index10 alt2">&nbsp;</div><div class="line number12 index11 alt1"><code class="plain">&lt;</code><code class="keyword">label</code> <code class="color1">for</code><code class="plain">=</code><code class="string">"autocomplete"</code><code class="plain">&gt;Select a programming language: &lt;/</code><code class="keyword">label</code><code class="plain">&gt;</code></div><div class="line number13 index12 alt2"><code class="plain">&lt;</code><code class="keyword">input</code> <code class="color1">id</code><code class="plain">=</code><code class="string">"autocomplete"</code><code class="plain">&gt;</code></div><div class="line number14 index13 alt1">&nbsp;</div><div class="line number15 index14 alt2"><code class="plain">&lt;</code><code class="keyword">script</code><code class="plain">&gt;</code></div><div class="line number16 index15 alt1"><code class="plain">$( "#autocomplete" ).autocomplete({</code></div><div class="line number17 index16 alt2"><code class="undefined spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="plain">source: [ "c++", "java", "php", "coldfusion", "javascript", "asp", "ruby" ]</code></div><div class="line number18 index17 alt1"><code class="plain">});</code></div><div class="line number19 index18 alt2"><code class="plain">&lt;/</code><code class="keyword">script</code><code class="plain">&gt;</code></div><div class="line number20 index19 alt1">&nbsp;</div><div class="line number21 index20 alt2"><code class="plain">&lt;/</code><code class="keyword">body</code><code class="plain">&gt;</code></div><div class="line number22 index21 alt1"><code class="plain">&lt;/</code><code class="keyword">html</code><code class="plain">&gt;</code></div></div></td></tr></tbody></table></div>
<h4>Demo:</h4>
<div class="demo code-demo"></div>
</div></section>
</div></article>

</body>
</html>

Zerion Mini Shell 1.0