Search
The Search is prominently featured in the Header, 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).
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.
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:
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).
Search info
The info
property doubles as both the placeholder
when the field
is expanded and the title
(or tooltip) when the field is collapsed.
Here' an overview of the properties and methods of the Search model.
If you find a bug or need a feature…