[Elements] are optional

Class SAPO.Component.Autocomplete

class SAPO.Component.Autocomplete

requires SAPO.Dom.Event

requires SAPO.Utility.String

requires SAPO.Communication.Ajax

Adds autocomplete behavior to a form input field

Defined in Component/Autocomplete/0.1/lib.js

Constructor Summary
Autocomplete (Object options)

Function Summary
Set given text on the target input box

Constructor Details

constructor Autocomplete

Autocomplete(Object options)
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
txt - text to be inserted