Print Friendly

Class YAHOO.widget.AutoComplete

Package:YAHOO.widget
Class:AutoComplete
Extends:Object
Defined In:autocomplete.js
The AutoComplete class provides the customizable functionality of a plug-and-play DHTML auto completion widget. Some key features:

Public Properties

Property Defined By
  ERROR_DATANULL : String AutoComplete
<static> Error message for null data responses.
  ERROR_DATAPARSE : String AutoComplete
<static> Error message for data responses with parsing errors.
  ERROR_DATAXHR : String AutoComplete
<static> Error message for XHR failure.
  TYPE_FLAT : Number AutoComplete
<static> Flat-file data type.
  TYPE_JSON : Number AutoComplete
<static> JSON data type.
  TYPE_XML : Number AutoComplete
<static> XML data type.
  allowBrowserAutocomplete : Boolean @default AutoComplete
Whether or not to allow browsers to cache user-typed input in the input field. Disabling this feature will prevent th...
  alwaysShowContainer : Boolean @default AutoComplete
Whether or not the results container should always be displayed. Enabling this feature displays the container when th...
  animHoriz : Boolean @default AutoComplete
Whether or not to animate the expansion/collapse of the results container in the horizontal direction.
  animSpeed : Number @default AutoComplete
Speed of container expand/collapse animation, in seconds..
  animVert : Boolean @default AutoComplete
Whether or not to animate the expansion/collapse of the results container in the vertical direction.
  autoHighlight : Boolean @default AutoComplete
Whether or not the first item in results container should be automatically highlighted on expand.
  connMgr : Object @default AutoComplete
Alias to YUI Connection Manager. Allows implementers to specify their own subclasses of the YUI Connection Manager ut...
  connTimeout : Number @default AutoComplete
Number of milliseconds the XHR connection will wait for a server response. A a value of zero indicates the XHR connec...
  data : Array AutoComplete
In-memory Javascript array of strings.
  dataFunction : HTMLFunction AutoComplete
In-memory Javascript function that returns query results.
  dataSource : Object AutoComplete
The DataSource object that encapsulates the data used for auto completion. This object should be an inherited object ...
  delimChar : String AutoComplete
Query delimiter. A single character separator for multiple delimited selections. Multiple delimiter characteres may b...
  forceSelection : Boolean @default AutoComplete
Whether or not to force the user's selection to match one of the query results. Enabling this feature essentially tra...
  highlighClassName : String @default AutoComplete
Class name of a highlighted item within results container.
  maxCacheEntries : Number @default AutoComplete
Max size of the local cache. Set to 0 to turn off caching. Caching is useful to reduce the number of server connect...
  maxResultsDisplayed : Number @default AutoComplete
Maximum number of results to display in results container.
  minQueryLength : Number @default AutoComplete
Number of characters that must be entered before querying for results. A negative value effectively turns off the wid...
  prehighlightClassName : String AutoComplete
Class name of a pre-highlighted item within results container.
  queryDelay : Number @default AutoComplete
Number of seconds to delay before submitting a query request. If a query request is received before a previous one h...
  queryMatchCase : Boolean @default AutoComplete
Enables query case-sensitivity matching. If caching is on and queryMatchCase is true, queries will only return result...
  queryMatchContains : Boolean @default AutoComplete
Use this to equate cache matching with the type of matching done by your live data source. If caching is on and query...
  queryMatchSubset : Boolean @default AutoComplete
Enables query subset matching. If caching is on and queryMatchSubset is true, substrings of queries will return match...
  responseStripAfter : String @default AutoComplete
String after which to strip results. If the results from the XHR are sent back as HTML, the gzip HTML comment appears...
  responseType : String @default AutoComplete
XHR response data type. Other types that may be defined are YAHOO.widget.DS_XHR.TYPE_XML and YAHOO.widget.DS_XHR.TYPE...
  scriptQueryAppend : String @default AutoComplete
String of key/value pairs to append to requests made to scriptURI. Define this string when you want to send additiona...
  scriptQueryParam : String @default AutoComplete
Query string parameter name sent to scriptURI. For instance, queries will be sent to <scriptURI>?<scriptQ...
  scriptURI : String AutoComplete
Absolute or relative URI to script that returns query results. For instance, queries will be sent to <scriptURI&#...
  typeAhead : Boolean @default AutoComplete
Whether or not the input field should be automatically updated with the first query result as the user types, auto-se...
  useIFrame : Boolean @default AutoComplete
Whether or not to use an iFrame to layer over Windows form elements in IE. Set to true only when the results containe...
  useShadow : Boolean @default AutoComplete
Whether or not the results container should have a shadow.

Public Methods

Method Defined By
  AutoComplete(elInput {HTMLElement}, elInput {String}, elContainer {HTMLElement}, elContainer {String}, oDataSource {Object}, [oConfigs {Object}]) AutoComplete
  doBeforeExpandContainer() : Boolean AutoComplete
Overridable method called before container expands allows implementers to access data and DOM elements.
  doQuery(oCallbackFn {HTMLFunction}, sQuery {String}, oParent {Object}) : void AutoComplete
Queries the live data source defined by data for results. Results are passed back to a callback function.
  flushCache() : void AutoComplete
Flushes cache.
  formatResult(oResultItem {Object}, sQuery {String}) : String AutoComplete
Overridable method that converts a result item object into HTML markup for display. Return data values are accessible...
  getListItemData() : Object AutoComplete
Public accessor to the data held in an <li> element of the results container.
  getListItems() : HTMLElement[] AutoComplete
Public accessor to the internal array of DOM <li> elements that display query results within the results contai...
  getResults(oCallbackFn {HTMLFunction}, sQuery {String}, oParent {Object}) : void AutoComplete
Retrieves query results, first checking the local cache, then making the query request to the live data source as def...
  isContainerOpen() : Boolean AutoComplete
Returns true if container is in an expanded state, false otherwise.
  parseResponse(sQuery {String}, oResponse {Object}, oParent {Object}) : s AutoComplete
Parses raw response data into an array of result objects. The result data key is always stashed in the [0] element of...
  sendQuery(sQuery {String}) : void AutoComplete
Makes query request to the DataSource.
  setBody(sHeader {String}) : void AutoComplete
Sets HTML markup for the results container body. This markup will be inserted within a <div> tag with a class o...
  setFooter(sFooter {String}) : void AutoComplete
Sets HTML markup for the results container footer. This markup will be inserted within a <div> tag with a class...
  setHeader(sHeader {String}) : void AutoComplete
Sets HTML markup for the results container header. This markup will be inserted within a <div> tag with a class...
  toString() : String AutoComplete
Public accessor to the unique name of the DataSource instance.

Public Events

Event Defined By
  cacheFlushEvent : (oSelf {Object}) AutoComplete
Fired when the local cache is flushed.
  cacheQueryEvent : (oSelf {Object}, oParent {Object}, sQuery {String}) AutoComplete
Fired when a query is made to the local cache.
  containerCollapseEvent : (oSelf {Object}) AutoComplete
Fired when the results container is collapsed.
  containerExpandEvent : (oSelf {Object}) AutoComplete
Fired when the results container is expanded.
  dataErrorEvent : (oSelf {Object}, oParent {Object}, sQuery {String}, sMsg {String}) AutoComplete
Fired when an error is encountered with the live data source.
  dataRequestEvent : (oSelf {Object}, sQuery {String}) AutoComplete
Fired when the AutoComplete instance makes a query to the DataSource.
  dataReturnEvent : (oSelf {Object}, sQuery {String}, aResults {Array}) AutoComplete
Fired when the AutoComplete instance receives query results from the data source.
  getCachedResultsEvent : (oSelf {Object}, oParent {Object}, sQuery {String}, aResults {Object[]}) AutoComplete
Fired when data is retrieved from the local cache.
  getResultsEvent : (oSelf {Object}, oParent {Object}, sQuery {String}, aResults {Object[]}) AutoComplete
Fired when data is retrieved from the live data source.
  itemArrowFromEvent : (oSelf {Object}, elItem {HTMLElement}) AutoComplete
Fired when result item has been arrowed away from.
  itemArrowToEvent : (oSelf {Object}, elItem {HTMLElement}) AutoComplete
Fired when result item has been arrowed to.
  itemMouseOutEvent : (oSelf {Object}, elItem {HTMLElement}) AutoComplete
Fired when result item has been moused out.
  itemMouseOverEvent : (oSelf {Object}, elItem {HTMLElement}) AutoComplete
Fired when result item has been moused over.
  itemSelectEvent : (oSelf {Object}, elItem {HTMLElement}, oData {Object}) AutoComplete
Fired when an item is selected via mouse click, ENTER key, or TAB key.
  queryEvent : (oSelf {Object}, oParent {Object}, sQuery {String}) AutoComplete
Fired when a query is made to the live data source.
  selectionEnforceEvent : (oSelf {Object}) AutoComplete
Fired if forceSelection is enabled and the user's input has been cleared because it did not match one of the returned...
  textboxBlurEvent : (oSelf {Object}) AutoComplete
Fired when the input field loses focus.
  textboxFocusEvent : (oSelf {Object}) AutoComplete
Fired when the input field receives focus.
  textboxKeyEvent : (oSelf {Object}, nKeycode {Number}) AutoComplete
Fired when the input field receives key input.
  typeAheadEvent : (oSelf {Object}, sQuery {String}, sPrefill {String}) AutoComplete
Fired when the input field has been prefilled by the type-ahead feature.
  unmatchedItemSelectEvent : (oSelf {Object}, sQuery {String}) AutoComplete
Fired when a user selection does not match any of the displayed result items. Note that this event may not behave as ...

Property Details

ERROR_DATANULL

public String ERROR_DATANULL
<static> Error message for null data responses.
This property is defined by AutoComplete.

ERROR_DATAPARSE

public String ERROR_DATAPARSE
<static> Error message for data responses with parsing errors.
This property is defined by AutoComplete.

ERROR_DATAXHR

public String ERROR_DATAXHR
<static> Error message for XHR failure.
This property is defined by AutoComplete.

TYPE_FLAT

public Number TYPE_FLAT
<static> Flat-file data type.
This property is defined by AutoComplete.

TYPE_JSON

public Number TYPE_JSON
<static> JSON data type.
This property is defined by AutoComplete.

TYPE_XML

public Number TYPE_XML
<static> XML data type.
This property is defined by AutoComplete.

allowBrowserAutocomplete

public Boolean @default allowBrowserAutocomplete
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.
This property is defined by AutoComplete.

alwaysShowContainer

public Boolean @default alwaysShowContainer
Whether or not the results container should always be displayed. Enabling this feature displays the container when the widget is instantiated and prevents the toggling of the container to a collapsed state.
This property is defined by AutoComplete.

animHoriz

public Boolean @default animHoriz
Whether or not to animate the expansion/collapse of the results container in the horizontal direction.
This property is defined by AutoComplete.

animSpeed

public Number @default animSpeed
Speed of container expand/collapse animation, in seconds..
This property is defined by AutoComplete.

animVert

public Boolean @default animVert
Whether or not to animate the expansion/collapse of the results container in the vertical direction.
This property is defined by AutoComplete.

autoHighlight

public Boolean @default autoHighlight
Whether or not the first item in results container should be automatically highlighted on expand.
This property is defined by AutoComplete.

connMgr

public Object @default connMgr
Alias to YUI Connection Manager. Allows implementers to specify their own subclasses of the YUI Connection Manager utility.
This property is defined by AutoComplete.

connTimeout

public Number @default connTimeout
Number of milliseconds the XHR connection will wait for a server response. A a value of zero indicates the XHR connection will wait forever. Any value greater than zero will use the Connection utility's Auto-Abort feature.
This property is defined by AutoComplete.

data

public Array data
In-memory Javascript array of strings.
This property is defined by AutoComplete.

dataFunction

public HTMLFunction dataFunction
In-memory Javascript function that returns query results.
This property is defined by AutoComplete.

dataSource

public Object dataSource
The DataSource object that encapsulates the data used for auto completion. This object should be an inherited object from YAHOO.widget.DataSource.
This property is defined by AutoComplete.

delimChar

public String delimChar
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.
This property is defined by AutoComplete.

forceSelection

public Boolean @default forceSelection
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.
This property is defined by AutoComplete.

highlighClassName

public String @default highlighClassName
Class name of a highlighted item within results container.
This property is defined by AutoComplete.

maxCacheEntries

public Number @default maxCacheEntries
Max size of the local cache. Set to 0 to turn off caching. Caching is useful to reduce the number of server connections. Recommended only for data sources that return comprehensive results for queries or when stale data is not an issue.
This property is defined by AutoComplete.

maxResultsDisplayed

public Number @default maxResultsDisplayed
Maximum number of results to display in results container.
This property is defined by AutoComplete.

minQueryLength

public Number @default minQueryLength
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.
This property is defined by AutoComplete.

prehighlightClassName

public String prehighlightClassName
Class name of a pre-highlighted item within results container.
This property is defined by AutoComplete.

queryDelay

public Number @default queryDelay
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.
This property is defined by AutoComplete.

queryMatchCase

public Boolean @default queryMatchCase
Enables query case-sensitivity matching. If caching is on and queryMatchCase is true, queries will only return results for case-sensitive matches.
This property is defined by AutoComplete.

queryMatchContains

public Boolean @default queryMatchContains
Use this to equate cache matching with the type of matching done by your live data source. If caching is on and queryMatchContains is true, the cache returns results that "contain" the query string. By default, queryMatchContains is set to false, meaning the cache only returns results that "start with" the query string.
This property is defined by AutoComplete.

queryMatchSubset

public Boolean @default queryMatchSubset
Enables query subset matching. If caching is on 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.
This property is defined by AutoComplete.

responseStripAfter

public String @default responseStripAfter
String after which to strip results. If the results from the XHR are sent back as HTML, the gzip HTML comment appears at the end of the data and should be ignored.
This property is defined by AutoComplete.

responseType

public String @default responseType
XHR response data type. Other types that may be defined are YAHOO.widget.DS_XHR.TYPE_XML and YAHOO.widget.DS_XHR.TYPE_FLAT.
This property is defined by AutoComplete.

scriptQueryAppend

public String @default scriptQueryAppend
String of key/value pairs to append to requests made to scriptURI. Define this string when you want to send additional query parameters to your script. When defined, queries will be sent to <scriptURI>?<scriptQueryParam>=userinput&<scriptQueryAppend>
This property is defined by AutoComplete.

scriptQueryParam

public String @default scriptQueryParam
Query string parameter name sent to scriptURI. For instance, queries will be sent to <scriptURI>?<scriptQueryParam>=userinput
This property is defined by AutoComplete.

scriptURI

public String scriptURI
Absolute or relative URI to script that returns query results. For instance, queries will be sent to <scriptURI>?<scriptQueryParam>=userinput
This property is defined by AutoComplete.

typeAhead

public Boolean @default typeAhead
Whether or not the input field should be automatically updated with the first query result as the user types, auto-selecting the substring that the user has not typed.
This property is defined by AutoComplete.

useIFrame

public Boolean @default useIFrame
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).
This property is defined by AutoComplete.

useShadow

public Boolean @default useShadow
Whether or not the results container should have a shadow.
This property is defined by AutoComplete.

Constructor Details

AutoComplete

public function AutoComplete(elInput {HTMLElement}, elInput {String}, elContainer {HTMLElement}, elContainer {String}, oDataSource {Object}, [oConfigs {Object}])
Parameters:
  • {HTMLElement} : elInput
    DOM element reference of an input field
  • {String} : elInput
    String ID of an input field
  • {HTMLElement} : elContainer
    DOM element reference of an existing DIV
  • {String} : elContainer
    String ID of an existing DIV
  • {Object} : oDataSource
    Instance of YAHOO.widget.DataSource for query/results
  • {Object} : oConfigs
    (optional) Object literal of configuration params

Method Details

doBeforeExpandContainer

public function doBeforeExpandContainer()
Overridable method called before container expands allows implementers to access data and DOM elements.
Parameters:
  • None.
Returns:
  • Boolean
    Return true to continue expanding container, false to cancel the expand.
This method is defined by AutoComplete.

doQuery

public function doQuery(oCallbackFn {HTMLFunction}, sQuery {String}, oParent {Object})
Queries the live data source defined by data for results. Results are passed back to a callback function.
Parameters:
  • {HTMLFunction} : oCallbackFn
    Callback function defined by oParent object to which to return results.
  • {String} : sQuery
    Query string.
  • {Object} : oParent
    The object instance that has requested data.
Returns:
  • void
This method is defined by AutoComplete.

flushCache

public function flushCache()
Flushes cache.
Parameters:
  • None.
Returns:
  • void
This method is defined by AutoComplete.

formatResult

public function formatResult(oResultItem {Object}, sQuery {String})
Overridable method that converts a result item object into HTML markup for display. Return data values are accessible via the oResultItem object, and the key return value will always be oResultItem[0]. Markup will be displayed within <li> element tags in the container.
Parameters:
  • {Object} : oResultItem
    Result item representing one query result. Data is held in an array.
  • {String} : sQuery
    The current query string.
Returns:
  • String
    HTML markup of formatted result data.
This method is defined by AutoComplete.

getListItemData

public function getListItemData()
Public accessor to the data held in an <li> element of the results container.
Parameters:
  • None.
Returns:
  • Object
    | Array} Object or array of result data or null
This method is defined by AutoComplete.

getListItems

public function getListItems()
Public accessor to the internal array of DOM <li> elements that display query results within the results container.
Parameters:
  • None.
Returns:
  • HTMLElement[]
    Array of <li> elements within the results container.
This method is defined by AutoComplete.

getResults

public function getResults(oCallbackFn {HTMLFunction}, sQuery {String}, oParent {Object})
Retrieves query results, first checking the local cache, then making the query request to the live data source as defined by the function doQuery.
Parameters:
  • {HTMLFunction} : oCallbackFn
    Callback function defined by oParent object to which to return results.
  • {String} : sQuery
    Query string.
  • {Object} : oParent
    The object instance that has requested data.
Returns:
  • void
This method is defined by AutoComplete.

isContainerOpen

public function isContainerOpen()
Returns true if container is in an expanded state, false otherwise.
Parameters:
  • None.
Returns:
  • Boolean
    Returns true if container is in an expanded state, false otherwise.
This method is defined by AutoComplete.

parseResponse

public function parseResponse(sQuery {String}, oResponse {Object}, oParent {Object})
Parses raw response data into an array of result objects. The result data key is always stashed in the [0] element of each result object.
Parameters:
  • {String} : sQuery
    Query string.
  • {Object} : oResponse
    The raw response data to parse.
  • {Object} : oParent
    The object instance that has requested data.
Returns:
  • s
    {Object[]} Array of result objects.
This method is defined by AutoComplete.

sendQuery

public function sendQuery(sQuery {String})
Makes query request to the DataSource.
Parameters:
  • {String} : sQuery
    Query string.
Returns:
  • void
This method is defined by AutoComplete.

setBody

public function setBody(sHeader {String})
Sets HTML markup for the results container body. This markup will be inserted within a <div> tag with a class of "ac_bd".
Parameters:
  • {String} : sHeader
    HTML markup for results container body.
Returns:
  • void
This method is defined by AutoComplete.

setFooter

public function setFooter(sFooter {String})
Sets HTML markup for the results container footer. This markup will be inserted within a <div> tag with a class of "ac_ft".
Parameters:
  • {String} : sFooter
    HTML markup for results container footer.
Returns:
  • void
This method is defined by AutoComplete.

setHeader

public function setHeader(sHeader {String})
Sets HTML markup for the results container header. This markup will be inserted within a <div> tag with a class of "ac_hd".
Parameters:
  • {String} : sHeader
    HTML markup for results container header.
Returns:
  • void
This method is defined by AutoComplete.

toString

public function toString()
Public accessor to the unique name of the DataSource instance.
Parameters:
  • None.
Returns:
  • String
    Unique name of the DataSource instance
This method is defined by AutoComplete.

Event Details

cacheFlushEvent

public event cacheFlushEvent
Fired when the local cache is flushed.
Subscribers will be called with the following parameters:
  • {Object} : oSelf
    The DataSource instance
This event is defined by AutoComplete.

cacheQueryEvent

public event cacheQueryEvent
Fired when a query is made to the local cache.
Subscribers will be called with the following parameters:
  • {Object} : oSelf
    The DataSource instance.
  • {Object} : oParent
    The requesting object.
  • {String} : sQuery
    The query string.
This event is defined by AutoComplete.

containerCollapseEvent

public event containerCollapseEvent
Fired when the results container is collapsed.
Subscribers will be called with the following parameters:
  • {Object} : oSelf
    The AutoComplete instance.
This event is defined by AutoComplete.

containerExpandEvent

public event containerExpandEvent
Fired when the results container is expanded.
Subscribers will be called with the following parameters:
  • {Object} : oSelf
    The AutoComplete instance.
This event is defined by AutoComplete.

dataErrorEvent

public event dataErrorEvent
Fired when an error is encountered with the live data source.
Subscribers will be called with the following parameters:
  • {Object} : oSelf
    The DataSource instance.
  • {Object} : oParent
    The requesting object.
  • {String} : sQuery
    The query string.
  • {String} : sMsg
    Error message string
This event is defined by AutoComplete.

dataRequestEvent

public event dataRequestEvent
Fired when the AutoComplete instance makes a query to the DataSource.
Subscribers will be called with the following parameters:
  • {Object} : oSelf
    The AutoComplete instance.
  • {String} : sQuery
    The query string.
This event is defined by AutoComplete.

dataReturnEvent

public event dataReturnEvent
Fired when the AutoComplete instance receives query results from the data source.
Subscribers will be called with the following parameters:
  • {Object} : oSelf
    The AutoComplete instance.
  • {String} : sQuery
    The query string.
  • {Array} : aResults
    Results array.
This event is defined by AutoComplete.

getCachedResultsEvent

public event getCachedResultsEvent
Fired when data is retrieved from the local cache.
Subscribers will be called with the following parameters:
  • {Object} : oSelf
    The DataSource instance.
  • {Object} : oParent
    The requesting object.
  • {String} : sQuery
    The query string.
  • {Object[]} : aResults
    Array of result objects.
This event is defined by AutoComplete.

getResultsEvent

public event getResultsEvent
Fired when data is retrieved from the live data source.
Subscribers will be called with the following parameters:
  • {Object} : oSelf
    The DataSource instance.
  • {Object} : oParent
    The requesting object.
  • {String} : sQuery
    The query string.
  • {Object[]} : aResults
    Array of result objects.
This event is defined by AutoComplete.

itemArrowFromEvent

public event itemArrowFromEvent
Fired when result item has been arrowed away from.
Subscribers will be called with the following parameters:
  • {Object} : oSelf
    The AutoComplete instance.
  • {HTMLElement} : elItem
    The <li> element item arrowed from.
This event is defined by AutoComplete.

itemArrowToEvent

public event itemArrowToEvent
Fired when result item has been arrowed to.
Subscribers will be called with the following parameters:
  • {Object} : oSelf
    The AutoComplete instance.
  • {HTMLElement} : elItem
    The <li> element item arrowed to.
This event is defined by AutoComplete.

itemMouseOutEvent

public event itemMouseOutEvent
Fired when result item has been moused out.
Subscribers will be called with the following parameters:
  • {Object} : oSelf
    The AutoComplete instance.
  • {HTMLElement} : elItem
    The <li> element item moused from.
This event is defined by AutoComplete.

itemMouseOverEvent

public event itemMouseOverEvent
Fired when result item has been moused over.
Subscribers will be called with the following parameters:
  • {Object} : oSelf
    The AutoComplete instance.
  • {HTMLElement} : elItem
    The <li> element item moused to.
This event is defined by AutoComplete.

itemSelectEvent

public event itemSelectEvent
Fired when an item is selected via mouse click, ENTER key, or TAB key.
Subscribers will be called with the following parameters:
  • {Object} : oSelf
    The AutoComplete instance.
  • {HTMLElement} : elItem
    The selected <li> element item.
  • {Object} : oData
    The data returned for the item, either as an object, or mapped from the schema into an array.
This event is defined by AutoComplete.

queryEvent

public event queryEvent
Fired when a query is made to the live data source.
Subscribers will be called with the following parameters:
  • {Object} : oSelf
    The DataSource instance.
  • {Object} : oParent
    The requesting object.
  • {String} : sQuery
    The query string.
This event is defined by AutoComplete.

selectionEnforceEvent

public event selectionEnforceEvent
Fired if forceSelection is enabled and the user's input has been cleared because it did not match one of the returned query results.
Subscribers will be called with the following parameters:
  • {Object} : oSelf
    The AutoComplete instance.
This event is defined by AutoComplete.

textboxBlurEvent

public event textboxBlurEvent
Fired when the input field loses focus.
Subscribers will be called with the following parameters:
  • {Object} : oSelf
    The AutoComplete instance.
This event is defined by AutoComplete.

textboxFocusEvent

public event textboxFocusEvent
Fired when the input field receives focus.
Subscribers will be called with the following parameters:
  • {Object} : oSelf
    The AutoComplete instance.
This event is defined by AutoComplete.

textboxKeyEvent

public event textboxKeyEvent
Fired when the input field receives key input.
Subscribers will be called with the following parameters:
  • {Object} : oSelf
    The AutoComplete instance.
  • {Number} : nKeycode
    The keycode number.
This event is defined by AutoComplete.

typeAheadEvent

public event typeAheadEvent
Fired when the input field has been prefilled by the type-ahead feature.
Subscribers will be called with the following parameters:
  • {Object} : oSelf
    The AutoComplete instance.
  • {String} : sQuery
    The query string.
  • {String} : sPrefill
    The prefill string.
This event is defined by AutoComplete.

unmatchedItemSelectEvent

public event unmatchedItemSelectEvent
Fired when a user selection does not match any of the displayed result items. Note that this event may not behave as expected when delimiter characters have been defined.
Subscribers will be called with the following parameters:
  • {Object} : oSelf
    The AutoComplete instance.
  • {String} : sQuery
    The user-typed query string.
This event is defined by AutoComplete.

Copyright © 2006 Jack Slocum. All rights reserved.