[TIMOB-220] UISearchBar
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:52:24.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 0.8.0 |
Components | iOS |
Labels | feature, ios, iphone |
Reporter | Nolan Wright |
Assignee | Blain Hamon |
Created | 2011-04-15T02:25:36.000+0000 |
Updated | 2011-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');
No comments