logo

/Auto Complete|v2.1.6

Class

new AutoComplete(options)autoComplete.jsline 38

PARAMETERS
NameTypeDescription

options

Object

PROPERTIES
NameTypeDescription

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
NameTypeDescription

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
NameTypeDescription

isUse

Boolean

Whether use auto complete or not

setParams(paramStr, index)autoComplete.jsline 171

Set additional parameters at inputManager.

PARAMETERS
NameTypeDescription

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
NameTypeDescription

queries

Array

Result queries

setSearchApi(options)autoComplete.jsline 276

Reset serachApi

PARAMETERS
NameTypeDescription

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
NameTypeDescription

dataArr

Array

Data array from api server

setValue(keyword)autoComplete.jsline 162

Set inputManager's value to show at search element

PARAMETERS
NameTypeDescription

keyword

String

The string to show up at search element

showResultList()autoComplete.jsline 239

Show search result list area

Events

changeresult.jsline 414

Fired when the user's selected element in result list is changed

closeresult.jsline 148

Fired when hide the result list

Resizable