new AutoComplete(options)autoComplete.jsline 38
PARAMETERS
Name Type Description options
Object
PROPERTIES
Name Type Description usageStatistics
Boolean = true
Let us know the hostname. If you don't want to send the hostname, please set to false.
EXAMPLES
CommonJS
const AutoComplete = require('tui-auto-complete'); const autoComplete = new AutoComplete({'config': 'Default'});
Global Namespace
const autoComplete = new tui.AutoComplete({"config" : "Default"});
Arguments of AutoComplete Constructor
SAMPLE FILE: [AutoConfig.json]{@link https://github.com/nhn/tui.auto-complete/blob/master/src/js/autoComplete.js}
Instance Methods
clearReadyValue()autoComplete.jsline 283
clear ready value and set idle state
getValue()autoComplete.jsline 154
Return string in input element.
RETURNS:
{String
}
hideResultList()autoComplete.jsline 232
Hide search result list area
isShowResultList()autoComplete.jsline 216
Whether show the result list area or not.
RETURNS:
{Boolean
}
isUseAutoComplete()autoComplete.jsline 208
Get whether use auto complete or not
RETURNS:
{Boolean
}EXAMPLES
autoComplete.isUseAutoComplete(); => true|false
request(keyword)autoComplete.jsline 146
Request data at api server with keyword
PARAMETERS
Name Type Description keyword
String
The key word to send to Auto complete API
setCookieValue(isUse)autoComplete.jsline 187
Set Cookie value with whether use auto complete or not
PARAMETERS
Name Type Description isUse
Boolean
Whether use auto complete or not
setParams(paramStr, index)autoComplete.jsline 171
Set additional parameters at inputManager.
PARAMETERS
Name Type Description paramStr
string
String to be addition parameters.(saperator '&')
index
string
The index for setting key value
setQueries(queries)autoComplete.jsline 197
Save matched queries from server.
PARAMETERS
Name Type Description queries
Array
Result queries
setSearchApi(options)autoComplete.jsline 276
Reset serachApi
PARAMETERS
Name Type Description options
Object
searchApi option
EXAMPLES
autoComplete.setSearchApi({ 'st' : 111, 'r_lt' : 111, 'r_enc' : 'UTF-8', 'q_enc' : 'UTF-8', 'r_format' : 'json' });
setServerData(dataArr)autoComplete.jsline 179
Request to draw result at resultManager with data from api server.
PARAMETERS
Name Type Description dataArr
Array
Data array from api server
setValue(keyword)autoComplete.jsline 162
Set inputManager's value to show at search element
PARAMETERS
Name Type Description keyword
String
The string to show up at search element
showResultList()autoComplete.jsline 239
Show search result list area