Project: titanium
Issue TIMOB-20188: iOS: Setting UI.SearchBar.value after tableview creation has no effect.
Setting Titanium.UI.SearchBar value after creating tableview (or listview) is not reflecting in search results. Use the following code {code} var fruits = [ {title: 'Apples'}, {title: 'Bananas'}, {title: 'Strawberry'}, {title: 'Pineapple'},{title: 'Apples'}, {title: 'Bananas'}, {title: 'Strawberry'}, {title: 'Pineapple'}, {title: 'Apples'}, {title: 'Bananas'}, {title: 'Strawberry'}, {title: 'Pineapple'},{title: 'Apples'}, {title: 'Bananas'}, {title: 'Strawberry'}, {title: 'Pineapple'}, {title: 'Apples'}, {title: 'Bananas'}, {title: 'Strawberry'}, {title: 'Pineapple'},{title: 'Apples'}, {title: 'Bananas'}, {title: 'Strawberry'}, {title: 'Pineapple'}, {title: 'Apples'}, {title: 'Bananas'}, {title: 'Strawberry'}, {title: 'Pineapple'},{title: 'Apples'}, {title: 'Bananas'}, {title: 'Strawberry'}, {title: 'Pineapple'} ]; var sampleWindow = Ti.UI.createWindow(); var navWindow = Ti.UI.iOS.createNavigationWindow({ window: sampleWindow }); var search = Ti.UI.createSearchBar({hintText: "search by name", showCancel: true}); search.addEventListener("return", searchBarReturn); var tableView = Ti.UI.createTableView(); tableView.addEventListener("click", tableClicked); tableView.search = search; tableView.searchHidden = true; tableView.filterAttribute = 'customAttr'; sampleWindow.add(tableView); fillTableData(fruits); function fillTableData(_data){ var tempData = []; for(var i=0, j=_data.length;i
Story points: 3