SearchField Class

Form field used to initiate a search via web sockets

Constructors

SearchField( parent, config )
Used to instantiate this class
parentDOM element in which to render this component
configConfiguration settings (optional). See config options for more information.

Config Options

url
Relative path the to websocket endpoint (e.g. "/search"). You do not need to specify a full url with a "ws://" or "wss://" prefix.
searchDelay
Delay between the last user input and start of a new search.
style
Style for individual elements within the component. Note that you can provide CSS class names instead of individual style definitions.
onButtonClick
Function to call when the user clicks on the search button.

Events

onSelect( )
Called whenever a user selects an item from the drop-down menu

Public Methods

getValue( )
Used to retrieve the value for the key/id associated with the selected search result
setValue( value, silent )
clear( )
getInput( )
createFilter( text )
parseResponse( text )
Default method used to parse responses from the server. Should return an array of key/value pairs to insert into the combobox. Example: [["Bob","12/30"],["Jim","10/28"]]