Class: AutoComplete

MobileAge.Component.AutoComplete(dom, options)

AutoComplete-Component

Constructor

new AutoComplete(dom, options)

Class representing a single AutoComplete component.
Parameters:
Name Type Description
dom string Id, css-query or a ElementNode to connect to.
options Object
Properties
Name Type Attributes Default Description
formLabel String <optional>
"Label" Label text for the input element..
formName String <optional>
"" id of the input element.
formValue String <optional>
"" Value inserted in the input element.
formPlaceholder String <optional>
"" Placeholder text inserted in the input element.
wrapperLabel String <optional>
"" html of an element to wrap the label element. Usualy used to work with layout css frameworks. Example for using the Bootstrap grid layout <div class="col-md-3"></div>.
wrapperInput String <optional>
"" html of an element to wrap the input element. Usualy used to work with layout css frameworks. Example for using the Bootstrap grid layout <div class="col-md-9"></div>.
wrapperList String <optional>
"" html of an element to wrap the list element. Usualy used to work with layout css frameworks. Example for using the Bootstrap grid layout <div class="col-md-9"></div>.
wrapperStatus String <optional>
"" Name- and Id-Attribute for the component's dom element.
templateLabel String <optional>
<label for='<%id%>' class='<%bem%>'><%label%></label> html of an element to wrap the label of the input. Usualy used to work with layout css frameworks. Example for using the Bootstrap grid layout <div class="col-md-9"></div>.
statusOkay String <optional>
"" Name- and Id-Attribute for the component's dom element.
classActive String <optional>
"active" CSS-class to be added, if active.
minChars String <optional>
1 Minimum amount of characters, before a request is started
dataLimit String <optional>
0 Limits the number of results displayed
clientFiltering String <optional>
false Specifies, wether the data is requested completely and filtered client side.
clear String <optional>
true Specifies, wether the content of the dom element is deleted before adding the autocomplete.
Source:

Extends

Methods

(static) _addQuery(placeholder)

Adds a custom xhr-query
Parameters:
Name Type Description
placeholder string placeholder to be displayed inside the input field temporary
Source:

(static) _ckeyup(event)

Called on keyup event
Parameters:
Name Type Description
event Object
Source:

(static) _create()

Creates a AutoComplete-Component
Source:

(static) _createInput(placeholder)

Creates an input element with AutoComplete features
Parameters:
Name Type Description
placeholder string placeholder to be displayed inside the input field temporary
Source:

(static) _createLabel(label)

Creates a label element for the AutoComplete input
Parameters:
Name Type Description
label string Labeltext
Source:

(static) _createList()

Creates a list component showing the results of the autocomplete
Source:

(static) _keypress(event)

Called on keypress event
Parameters:
Name Type Description
event Object
Source:

(static) _onRequestData(data)

Callback function called when requested data is received
Parameters:
Name Type Description
data object requested data
Source:

(static) _select(e)

Adds item to the input, if selected
Parameters:
Name Type Description
e Object Event
Source:

(static) _validateInput(placeholder)

Checks validity of input
Parameters:
Name Type Description
placeholder string placeholder to be displayed inside the input field temporary
Source: