[Elements] are optional
Defined in
Component/Autocomplete/0.1/lib.js
Class SAPO.Component.Autocomplete
class
SAPO.Component.Autocomplete
Inclusion link: http://js.sapo.pt/SAPO/Component/Autocomplete/0.1/
Sample: http://js.sapo.pt/SAPO/Component/Autocomplete/sample/
Constructor Summary
Autocomplete
(Object
options)
Function Summary
setChosenText
(String
txt)
Set given text on the target input box
Constructor Details
constructor Autocomplete
Autocomplete(Object
options)
Parameters:
options
- component options -
String|Object textbox- html input box from which text will be autocompleted -
String|Object target- HTML element where the results will be shown -
String requestURI- URI which will be used to fetch data -
String requestVar- name of the parameter which is sent to the server with the data to autocomplete -
String requestParams- additional request parameters to be sent to the server -
String classNameSelected- classname applied to the selected item -
Function onSelectCallBack- function called when an option is selected. gets the selected option as a parameter -
Number min- minimum number of results -
Number resultLimit- maximum number of results
Function Details
function setChosenText
setChosenText(String
txt)
Set given text on the target input box
Parameters:
txt
- text to be inserted
requires SAPO.Dom.Event
requires SAPO.Utility.String
requires SAPO.Communication.Ajax
Adds autocomplete behavior to a form input field