Class SS.control.searchbox
SS.control.searchbox Dynamic search box control
Defined in: SS.control.searchbox.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
| Field Attributes | Field Name and Description |
|---|---|
|
set to true or false, yes or no to prevent an xml datasource from caching in the browser.
|
|
|
//false - always query the datasource for each search.
|
|
|
Flag to perform case sensitive matching.
|
|
|
Style sheet class applied to the search box.
|
|
|
Style sheet class applied to the list of search results where it has
been highlighted using the arrow keys.
|
|
|
Style sheet class applied to the list of search results.
|
|
|
Style sheet class applied to each result returned in the results list.
|
|
|
Style sheet class applied to the characters in the list of search results
where they match the input string.
|
|
|
URL pointing to and XML or plain text list of data to search.
|
|
|
Identifier of the searchbox control.
|
|
|
Identifier of the textbox input element.
|
|
|
Id of element that will hold the value of the selected result rather than displaying the
selected value in the search field.
|
|
|
Defines how results are matched.
|
|
|
Maximum number of results to display at one time.
|
|
|
Minimum number of characters needed before the search is performed.
|
|
|
Function called or evaluated {String} whenever an item has been selected.
|
|
|
Function called or evaluated {String} whenever the results list is hidden.
|
|
|
Function called or evaluated {String} whenever the results list is displayed.
|
|
|
Function called or evaluated {String} whenever the results list has been altered.
|
|
|
if datasource is a URL, then the value of the textbox is posted to the destination if set to true.
|
|
|
Index of the item selecetd (using arrow keys) in the returned search results list.
|
|
|
Text of the selected item from the list.
|
|
|
Value of the selected item from the list.
|
|
|
Pseudonym for datasource.
|
|
|
Name of the parameter which is attached to the URL containing the phrase entered in to the search box
input control.
|
|
|
Maximum number of visible items to display in the search results list.
|
|
|
XML node name.
|
|
|
XML title.
|
|
|
XML value.
|
|
|
Defines the path to the list of nodes.
|
| Method Attributes | Method Name and Description |
|---|---|
|
clear()
Clear the results list.
|
|
|
dataload(dl)
Handles the loading of data from the defined datasource.
|
|
|
output(c, e)
Displays the filtered list of search results to the screen.
|
|
|
render()
Renders the searchbox on the page.
|
|
|
search(c, e)
Searches through the returned data to find matching items based
on the users input query.
|
|
|
set(a, v)
Set an attribute of the searchbox control
|
Field Detail
<private>
_k
Keypress lock indicator. if set, keypress event should be ignored.
<private>
_o
Array containing matching elements from the data object.
<private>
_tid
Delay timer id.
cache
set to true or false, yes or no to prevent an xml datasource from caching in the browser.
Default = true.
cacheresults
//false - always query the datasource for each search.
//true - after first result set is returned, search within that result set for data.
Default = true.
casesensitive
Flag to perform case sensitive matching.
Default = false.
css
Style sheet class applied to the search box.
Default = ""
css_highlight
Style sheet class applied to the list of search results where it has
been highlighted using the arrow keys. Default = "SS_control_searchbox_highlight".
css_list
Style sheet class applied to the list of search results.
Default = "SS_control_searchbox_list"
css_listitem
Style sheet class applied to each result returned in the results list.
Default = "SS_control_searchbox_listitem".
css_match
Style sheet class applied to the characters in the list of search results
where they match the input string. Default = "SS_control_searchbox_match".
<private>
data
Array of objects from datasource: {text:value}
datasource
URL pointing to and XML or plain text list of data to search. This URL is called with the
a querystring parameter, as defined by srcparam, which contains the text entered.
"SS_control_searchbox_listitem".
<private>
delay
Number of milliseconds to wait from the last key stroke before doing the search.
Default = 350.
<private>
demlimiter
Delimiter to use when dealing with a text data source.
Default = "\n" (new line).
id
Identifier of the searchbox control.
idtb
Identifier of the textbox input element.
linkto
Id of element that will hold the value of the selected result rather than displaying the
selected value in the search field.
matchmode
Defines how results are matched.
0: text only, 1: value only, 2:text and value, 3:match all
Default = 0.
maxresults
Maximum number of results to display at one time.
Default = 25.
minchars
Minimum number of characters needed before the search is performed.
Default = 3.
onchange
Function called or evaluated {String} whenever an item has been selected.
onlisthide
Function called or evaluated {String} whenever the results list is hidden.
onlistshow
Function called or evaluated {String} whenever the results list is displayed.
onresults
Function called or evaluated {String} whenever the results list has been altered.
postvalue
if datasource is a URL, then the value of the textbox is posted to the destination if set to true.
Default = false.
selectedindex
Index of the item selecetd (using arrow keys) in the returned search results list.
Default = -1.
selectedtext
Text of the selected item from the list. This is cleared if doing a search.
selectedvalue
Value of the selected item from the list. This is cleared if doing a search.
src
Pseudonym for datasource. Use either src or datasource but not both.
srcparam
Name of the parameter which is attached to the URL containing the phrase entered in to the search box
input control. Set as blank to disable this feature. Default = "v".
<private>
value
Holds the value of the selected item from the results list.
visibleitems
Maximum number of visible items to display in the search results list.
After the number has been exceeded, a scroll bar is used to all users
to scroll through the rest of the search results.
Default = 6.
xnode_name
XML node name.
Default = "item".
xnode_title
XML title.
Default = "text".
xnode_value
XML value.
Default = "value".
xpath_nodes
Defines the path to the list of nodes.
Default = "list".
Method Detail
clear()
Clear the results list.
- Returns:
- null
dataload(dl)
Handles the loading of data from the defined datasource.
- Parameters:
- {SS.net.requestor} dl
- Data Loader object containing the results of the search request.
- Returns:
- null
{Boolean}
output(c, e)
Displays the filtered list of search results to the screen.
- Parameters:
- {Integer} c
- Character Code. Code of the last character that was entered.
- {Event} e
- Event triggered by the entering of a character.
- Returns:
- {Boolean} Flag to indicate if any results were displayed.
render()
Renders the searchbox on the page.
- Returns:
- null
search(c, e)
Searches through the returned data to find matching items based
on the users input query.
- Parameters:
- {Integer} c
- Character Code. Code of the last character that was entered.
- {Event} e
- Event triggered by the entering of a character.
- Returns:
- null
set(a, v)
Set an attribute of the searchbox control
- Since:
- v1.0.7.20090731
- Returns:
- null
