Whether or not the results container is currently open.
Whether or not the widget instance is currently active. If query results come back
but the user has already moved on, do not proceed with auto complete behavior.
Whether or not an item has been selected since the container was populated
with results. Reset to false by _populateList, and set to true when item is
selected.
Whether or not the mouse is currently over the results
container. This is necessary in order to prevent clicks on container items
from being text input field blur events.
_elBody
- private HTMLElement
Reference to body element within content element.
_elContent
- private HTMLElement
Reference to content element within container element.
Pointer to the currently highlighted <li> element in the container.
Pointer to the currently pre-highlighted <li> element in the container.
_elFooter
- private HTMLElement
Reference to footer element within content element.
_elHeader
- private HTMLElement
Reference to header element within content element.
_elIFrame
- private HTMLElement
Reference to iframe element within container element.
_elList
- private HTMLElement
Internal reference to <ul> elements that contains query results within the
results container.
_elShadow
- private HTMLElement
Reference to shadow element within container element.
_elTextbox
- private HTMLElement
Text input field DOM element.
Src to iFrame used when useIFrame = true. Supports implementations over SSL
as well.
Number of <li> elements currently displayed in results container.
_nIndex
- private Number
Internal class variable to index multiple AutoComplete instances.
Default Value: 0
Key code of the last key pressed in textbox.
TypeAhead delay timeout ID.
_oAnim
- private Boolean
Animation instance for container expand/collapse.
For users typing via certain IMEs, queries must be triggered by intervals,
since key events yet supported across all browsers for all IMEs.
Stores initial input value used to determine if textboxChangeEvent should be fired.
_sName
- private String
Name of AutoComplete instance.
Selections from previous queries (for saving delimited queries).
Default Value: ""
Whether or not to allow browsers to cache user-typed input in the input
field. Disabling this feature will prevent the widget from setting the
autocomplete="off" on the input field. When autocomplete="off"
and users click the back button after form submission, user-typed input can
be prefilled by the browser from its cache. This caching of user input may
not be desired for sensitive data, such as credit card numbers, in which
case, implementers should consider setting allowBrowserAutocomplete to false.
Default Value: true
Enabling this feature prevents the toggling of the container to a collapsed state.
Setting to true does not automatically trigger the opening of the container.
Implementers are advised to pre-load the container with an explicit "sendQuery()" call.
Default Value: false
Whether or not to animate the expansion/collapse of the results container in the
horizontal direction.
Default Value: false
Speed of container expand/collapse animation, in seconds..
Default Value: 0.3
Whether or not to animate the expansion/collapse of the results container in the
vertical direction.
Default Value: true
By default, results from local DataSources will pass through the filterResults
method to apply a client-side matching algorithm.
Default Value: true for local arrays and json, otherwise false
Whether or not the first item in results container should be automatically highlighted
on expand.
Default Value: true
If true, before each time the container expands, the container element will be
positioned to snap to the bottom-left corner of the input element. If
autoSnapContainer is set to false, this positioning will not be done.
Default Value: true
dataSource
- YAHOO.widget.DataSource
The DataSource object that encapsulates the data used for auto completion.
This object should be an inherited object from YAHOO.widget.DataSource.
delimChar
- String | String[]
Query delimiter. A single character separator for multiple delimited
selections. Multiple delimiter characteres may be defined as an array of
strings. A null value or empty string indicates that query results cannot
be delimited. This feature is not recommended if you need forceSelection to
be true.
Whether or not to force the user's selection to match one of the query
results. Enabling this feature essentially transforms the input field into a
<select> field. This feature is not recommended with delimiter character(s)
defined.
Default Value: false
Class name of a highlighted item within results container.
Default Value: "yui-ac-highlight"
Maximum number of results to display in results container.
Default Value: 10
Number of characters that must be entered before querying for results. A negative value
effectively turns off the widget. A value of 0 allows queries of null or empty string
values.
Default Value: 1
Class name of a pre-highlighted item within results container.
Number of seconds to delay before submitting a query request. If a query
request is received before a previous one has completed its delay, the
previous request is cancelled and the new request is set to the delay. If
typeAhead is also enabled, this value must always be less than the typeAheadDelay
in order to avoid certain race conditions.
Default Value: 0.2
When IME usage is detected or interval detection is explicitly enabled,
AutoComplete will detect the input value at the given interval and send a
query if the value has changed.
Default Value: 500
When applyLocalFilter is true, the local filtering algorthim can have case sensitivity
enabled.
Default Value: false
When applyLocalFilter is true, results can be locally filtered to return
matching strings that "contain" the query string rather than simply "start with"
the query string.
Default Value: false
Enables query subset matching. When the DataSource's cache is enabled and queryMatchSubset is
true, substrings of queries will return matching cached results. For
instance, if the first query is for "abc" susequent queries that start with
"abc", like "abcd", will be queried against the cache, and not the live data
source. Recommended only for DataSources that return comprehensive results
for queries with very few characters.
Default Value: false
For XHR DataSources, AutoComplete will automatically insert a "?" between the server URI and
the "query" param/value pair. To prevent this behavior, implementers should
set this value to false. To more fully customize the query syntax, implementers
should override the generateRequest() method.
Default Value: true
For backward compatibility to pre-2.6.0 formatResults() signatures, setting
resultsTypeList to true will take each object literal result returned by
DataSource and flatten into an array.
Default Value: true
Whether or not the input field should be updated with selections.
Default Value: false
If autohighlight is enabled, whether or not the input field should be automatically updated
with the first query result as the user types, auto-selecting the substring portion
of the first result that the user has not yet typed.
Default Value: false
If typeAhead is true, number of seconds to delay before updating input with
typeAhead value. In order to prevent certain race conditions, this value must
always be greater than the queryDelay.
Default Value: 0.5
Whether or not to use an iFrame to layer over Windows form elements in
IE. Set to true only when the results container will be on top of a
<select> field in IE and thus exposed to the IE z-index bug (i.e.,
5.5 < IE < 7).
Default Value: false
Whether or not the results container should have a shadow.
Default Value: false