_afterValueChange
protected
void
_afterValueChange
(
e
)
value attribute.
- Parameters:
-
e <EventFacade>
_createArraySource
protected
Object
_createArraySource
(
source
)
source attribute for more details.
- Parameters:
-
source <Array>
- Returns:
Object - DataSource-like object.
_createJSONPSource
protected
Object
_createJSONPSource
(
source
)
source attribute for more
details.
- Parameters:
-
source <JSONPRequest>
- Returns:
Object - DataSource-like object.
_createObjectSource
protected
Object
_createObjectSource
(
source
)
source attribute for more details.
- Parameters:
-
source <Object>
- Returns:
Object - DataSource-like object.
_createStringSource
protected
Object
_createStringSource
(
source
)
source attribute for more details.
- Parameters:
-
source <String>JSONP URL or YQL query.
- Returns:
Object - DataSource-like object.
_createYQLSource
protected
Object
_createYQLSource
(
source
)
source attribute for
details. If no resultListLocator is defined, this method
will set a best-guess locator that might work for many typical YQL
queries.
- Parameters:
-
source <String>YQL query.
- Returns:
Object - DataSource-like object.
_defaultYQLLocator
protected
Array
_defaultYQLLocator
(
response
)
- Parameters:
-
response <Object>YQL response object.
_defClearFn
protected
void
_defClearFn
(
)
clear event handler. Sets the results
property to an empty array and query to null.
_defQueryFn
protected
void
_defQueryFn
(
e
)
query event handler. Sets the query
property and sends a request to the source if one is configured.
- Parameters:
-
e <EventFacade>
_defResultsFn
protected
void
_defResultsFn
(
e
)
results event handler. Sets the results
property to the latest results.
- Parameters:
-
e <EventFacade>
_functionValidator
protected
void
_functionValidator
(
value
)
true if value is either a function or
null.
- Parameters:
-
value <Function|null>Value to validate.
_getObjectValue
protected
mixed
_getObjectValue
(
obj
,
path
)
undefined nor an object.
- Parameters:
-
obj <Object> -
path <Array>
- Returns:
mixed - Located value, or
undefinedif the value was not found at the specified path.
_jsonpFormatter
protected
String
_jsonpFormatter
(
url
,
proxy
,
query
)
JSONPRequest instances.
- Parameters:
-
url <String> -
proxy <String> -
query <String>
- Returns:
String - Formatted URL
_onInputValueChange
protected
void
_onInputValueChange
(
e
)
valueChange events on the input node and fires a
query event when the input value meets the configured
criteria.
- Parameters:
-
e <EventFacade>
_onResponse
protected
void
_onResponse
(
e
)
results event.
- Parameters:
-
e <EventFacade>
_parseResponse
protected
void
_parseResponse
(
query
,
response
,
data
)
results event.
- Parameters:
-
query <String>Query that generated these results. -
response <Object>Response containing results. -
data <Object>Raw response data.
_parseValue
protected
String|null
_parseValue
(
value
)
Returns the query portion of the specified input value, or
null if there is no suitable query within the input value.
If a query delimiter is defined, the query will be the last delimited part of of the string.
- Parameters:
-
value <String>Input value from which to extract the query.
- Returns:
String|null - query
_setLocator
protected
Function|null
_setLocator
(
locator
)
- Parameters:
-
locator <Function|String|null>
_setRequestTemplate
protected
Function|null
_setRequestTemplate
(
template
)
requestTemplate attribute.
- Parameters:
-
template <Function|String|null>
_setResultFilters
protected
Array
_setResultFilters
(
filters
)
resultFilters attribute.
- Parameters:
-
filters <Array|Function|String|null>null, a filter function, an array of filter functions, or a string or array of strings representing the names of methods onY.AutoCompleteFilters.
- Returns:
Array - Array of filter functions (empty if filters is
null).
_setResultHighlighter
protected
Function|null
_setResultHighlighter
(
highlighter
)
resultHighlighter attribute.
- Parameters:
-
highlighter <Function|String|null>null, a highlighter function, or a string representing the name of a method onY.AutoCompleteHighlighters.
_setSource
protected
DataSource|Object
_setSource
(
source
)
source attribute. Returns a DataSource or
a DataSource-like object depending on the type of source.
- Parameters:
-
source <Array|DataSource|Object|String>AutoComplete source. See thesourceattribute for details.
_sourceSuccess
protected
void
_sourceSuccess
(
data
,
request
)
- Parameters:
-
data <mixed>Response data. -
request <Object>Request object.
_syncBrowserAutocomplete
protected
void
_syncBrowserAutocomplete
(
)
allowBrowserAutocomplete
attribute.
_updateValue
protected
void
_updateValue
(
newVal
)
Updates the query portion of the value attribute.
If a query delimiter is defined, the last delimited portion of the input value will be replaced with the specified value.
- Parameters:
-
newVal <String>New value.
sendRequest
void
sendRequest
(
query
,
requestTemplate
)
Sends a request to the configured source. If no source is configured, this method won't do anything.
Usually there's no reason to call this method manually; it will be
called automatically when user input causes a query event to
be fired. The only time you'll need to call this method manually is if
you want to force a request to be sent when no user input has occurred.
- Parameters:
-
query <String>(optional) Query to send. If specified, thequeryattribute will be set to this query. If not specified, the current value of thequeryattribute will be used. -
requestTemplate <Function>(optional) Request template function. If not specified, the current value of therequestTemplateattribute will be used.