Search
The Search is prominently featured in the Main ToolBar, but you can use it anywhere on the page if you like. Note that the API is in any case identical.
You can initialize a Search with data-ts="Search"
. The classname ts-inset
will add an outline (so that we can see how it behaves on this white background).
The search field expands when the field is focused by the user or whenever there's a non-empty value in the field. You can change the value like this:
To keep the field expanded at all times, simply assign the CSS classname ts-expanded
.
Search info
The data-ts.info
attribute works to show a title
(mouseover tooltip) when the field is collapsed and a placeholder
when the field is expanded.
Search callbacks
The onsearch
callback gets invoked when when the user presses ENTER.
If defined, the onidle
method gets called whenever the user pauses typing.
The onidle
method may also be called when the field loses focus. The idletime
property controls the timeout value, default is 500
(milliseconds).
Here' an overview of the properties and methods of the Search component.