Details
-
Type:
New Feature
-
Status: Open
-
Priority:
High
-
Resolution: Unresolved
-
Affects Version/s: Release 1.7.2, Release 1.7.3, Release 1.8.0
-
Fix Version/s: None
-
Component/s: TiAPI
-
Environment:
iOS 4.3, Simulator
mobile SDK 1.7.2, 1.7.3v20111007133015, 1.8.0.v20111011161014
Description
Feature information
Would like to be able to filter the rows by the accurate starting string.
Reproducible Steps
1. Execute this sample code
2. Put 'h' into the searchBar
Expected Result
The rows that are shown after putting the 'h' character should be the one that are starting with 'h'.
Example screen shot attached.
Sample Code
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
|
Titanium.UI.setBackgroundColor('#000');
|
|
var win1 = Titanium.UI.createWindow({
|
title:'Tab 1',
|
backgroundColor:'#fff'
|
});
|
|
// create table view data object
|
var data = [
|
{title:'Alan', hasChild:true, header:'A'},
|
{title:'Alice', hasDetail:true},
|
{title:'Alexander'},
|
{title:'Amos'},
|
{title:'Alonzo'},
|
{title:'Brad', header:'B'},
|
{title:'Brent'},
|
{title:'Billy'},
|
{title:'Brenda'},
|
{title:'Callie', header:'C'},
|
{title:'Cassie'},
|
{title:'Chris'},
|
{title:'Cameron'},
|
{title:'Don', header:'D'},
|
{title:'Dilbert'},
|
{title:'Deacon'},
|
{title:'Devin'},
|
{title:'Darin'},
|
{title:'Darcy'},
|
{title:'Erin', header:'E'},
|
{title:'Erica'},
|
{title:'Elvin'},
|
{title:'Edrick'},
|
{title:'Frank', header:'F'},
|
{title:'Fred'},
|
{title:'Fran'},
|
{title:'Felicity'},
|
{title:'George', header:'G'},
|
{title:'Gina'},
|
{title:'Gary'},
|
{title:'Herbert', header:'H'},
|
{title:'Henry'},
|
{title:'Harold'},
|
{title:'Ignatius', header:'I'},
|
{title:'Irving'},
|
{title:'Ivan'},
|
{title:'Dr. J', header:'J'},
|
{title:'Jefferson'},
|
{title:'Jenkins'},
|
{title:'Judy'},
|
{title:'Julie'},
|
{title:'Kristy', header:'K'},
|
{title:'Krusty the Clown'},
|
{title:'Klaus'},
|
{title:'Larry', header:'L'},
|
{title:'Leon'},
|
{title:'Lucy'},
|
{title:'Ludwig'},
|
{title:'Mary', header:'M'},
|
{title:'Mervin'},
|
{title:'Malcom'},
|
{title:'Mellon'},
|
{title:'Ned', header:'N'},
|
{title:'Nervous Eddie'},
|
{title:'Nelson'},
|
{title:'The Big O', header:'O'},
|
{title:'Orlando'},
|
{title:'Ox'},
|
{title:'Pluto', header:'P'},
|
{title:'Paris'},
|
{title:'Potsie'}
|
];
|
|
var search = Titanium.UI.createSearchBar({
|
showCancel:false
|
});
|
// create table view
|
var tableview = Titanium.UI.createTableView({
|
data:data,
|
search:search,
|
filterAttribute:'title'
|
});
|
|
|
// add table view to the window
|
win1.add(tableview);
|
|
win1.open();
|
|