Skip to content

SearchBox Class

jackhand edited this page Jun 14, 2016 · 4 revisions

Represents a control that allows users to search for content using a key layout optimized for TV. The reason the key layout is a strip of letters rather than a traditional square keyboard layout is because typing using a controller or remote is much more cumbersome than a keyboard. Because of this fact, the desired user experience for a TV app is that the user only needs to type a couple characters and then select from a search result or auto-suggested result.

It is important to populate search results as the user types by listening for the queryChanged event. This way users will not have to type the entire query.

###Syntax

var searchBox = new TVJS.SearchBox();

###Constructors SearchBox() Creates a new SearchBox.

###Properties
element
Type HTMLElement
Gets the element that contains the SearchBox.

placeholderText
Type string
Gets or sets the default text for the SearchBox control.
queryText Gets or sets the query text that the user entered into the SearchBox control.

###Methods dispose() Releases the resources reserved by the SearchBox.

###Events

querychanged
Event signaling that the value of the SearchBox.queryText property has changed.
detail.queryText the value of the text in the SearchBox control.

Namespace: TVJS