Search
A text searchbox input widget.
search
search(options)
Return a new search component with the provided options. Creates an instance of the Search
class, connects it to coordinator
, and returns the corresponding HTML element.
The supported options are:
- as: A
Param
orSelection
that this search box should update. If aParam
, simply sets the param to the input query string. If aSelection
, adds a predicate that searches for the input text value, as determined by the type option. - type: The type of text matching to perform, one of
"contains"
(default),"prefix"
,"suffix"
, or"regexp"
(regular expression) matching. - from: The name of the backing database table or view. If specified alongside the column options, the autocomplete options will be set to the distinct column values.
- column: The backing database column to search over.
- label: A text label for the search box input.
- element: The container DOM element. If unspecified, a new
div
is created.
Examples
Create a new search box with autocomplete values pulled from table.foo
in the backing database:
js
search({ from: "table", column: "foo", as: selection })
Search
new Search(options)
Class definition for a search box input that extends MosaicClient
. The constructor accepts the same options as the search
method.
element
search.element
The HTML element containing the search box input.