/ti.searchbar

Titanium Widget to display a search bar.

Primary LanguageJavaScriptMIT LicenseMIT

Ti.Searchbar

com.caffeina.titanium.searchbar

Titanium Widget to display a search bar.

image

Installation

Via Gittio

gittio install com.caffeina.titanium.searchbar

Via Github

Download the latest release, and add in your config.json, under dependencies:

"dependencies": {
    "com.caffeina.titanium.searchbar": "*"
}

Fully stylable via TSS

Watch the widget.tss file for all options and override the rules with ID instead of class.

Usage

In you XML file:

<TitleControl>
    <Widget id="searchBar" src="com.caffeina.titanium.searchbar" title="Caffeina" />
</TitleControl>

In your JS file:

$.searchBar.on('change', function(e) {
    // Filter your data using e.value
})

Constructor options

animationsDuration (Number, default: 400)

The duration of the animations.

title (String, default: Ti.App.name)

The title for the label.

API

.setSearchMode()

Set the UI in search mode.

.setTitleMode()

Set the UI in title mode.