Issue
Table view search disappearing row views. When using custom table rows with label don't behave well with search.
Expected behavior
It is working as expected in 1.8.2.
Tested on
iOS 5 simulator
Steps to reproduce - Grab & Throw sample below to an app.js
1. Focus search bar
2. Type 'row'
3. Press backspace so search bar shows 'ro'
4. the labels are not redrawn for the table rows. When you try to search over again noticed labels aren't correctly redrawn (as seen in the pertinent screen shoot).
Repro sequence
var win = Ti.UI.createWindow();
createTableRow = function(args){
// save the title for our own use
var title = args.title;
args.title = '';
args.left = 42;
args.height = 40;
var row = Ti.UI.createTableViewRow(args);
var label = Ti.UI.createLabel({
backgroundColor: 'pink',
text: title,
textAlign: Ti.UI.TEXT_ALIGNMENT_LEFT,
width: Ti.UI.FILL,
height: args.height - 5,
left: args.left,
font: { fontSize: 17, fontWeight: 'bold'},
});
row.add(label);
row.label_title = title;
return row;
};
var rows = [];
rows.push( createTableRow({ title: 'table', leftImage: '/KS_nav_ui.png'}) );
rows.push( createTableRow({ title: 'row', leftImage: '/KS_nav_ui.png'}) );
rows.push( createTableRow({ title: 'rock' }) );
rows.push( createTableRow({ title: 'car', leftImage: '/KS_nav_ui.png'}) );
rows.push( createTableRow({ title: 'tab' }) );
rows.push( createTableRow({ title: 'row boat', leftImage: '/KS_nav_ui.png'}) );
rows.push( createTableRow({ title: 'table row', leftImage: '/KS_nav_ui.png'}) );
rows.push( createTableRow({ title: 'test', leftImage: '/KS_nav_ui.png'}) );
rows.push( createTableRow({ title: 'apple' }) );
var search = Ti.UI.createSearchBar({
showCancel: false
});
var table = Ti.UI.createTableView({
data: rows,
search: search,
searchHidden: false,
filterAttribute: 'label_title',
filterCaseInsensitive: true
});
win.add(table);
win.open();
Side issue is fixed by PR https://github.com/appcelerator/titanium_mobile/pull/2288
Closing issue Tested with Ti Studio build 2.1.0.201206172244 Ti Mobile SDK2.1.0.v20120618134156 hash r00905cd0 OSX Lion 10.7.3 iPhone 4S OS 5.1 The expected behavior is shown
Reopening to update labels.