Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-220] UISearchBar

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:52:24.000+0000
Affected Version/sn/a
Fix Version/sRelease 0.8.0
ComponentsiOS
Labelsfeature, ios, iphone
ReporterNolan Wright
AssigneeBlain Hamon
Created2011-04-15T02:25:36.000+0000
Updated2011-04-17T01:52:24.000+0000

Description

Description

Allow for search to be placed in an HTML element or in the table view


// add to DIV with ID = foo
var search = Titanium.UI.createSearchBar({
    id:'foo',
    barColor:'#336699',
    showCancel:true,
});
search.addEventListener('change', function(e)
{
   e.value // search string as user types
});

// add to table view
var search = Titanium.UI.createSearchBar({
    barColor:'#336699',
    showCancel:true,
});
search.addEventListener('change', function(e)
{
   e.value // search string as user types
});

//
//  filterAttribute (title by default) is a table view data attribute that is used to filter results
//
var tableView = Titanium.UI.createTableView({data:data, search:search, filterAttribute:
'title'}, function(e)
{
});

tableView.setFilterAttribute('mynewattribute'); // allows you to toggle the search attribute.

// programtically filter your table views
tableView.filterView('my search string');

Comments

No comments

JSON Source