Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9016] iOS: tableView search causes row with label rendering issues

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-07-11T04:17:13.000+0000
Affected Version/sRelease 2.0.1
Fix Version/sRelease 2.1.0, Sprint 2012-11 API
ComponentsiOS
LabelsSupportTeam, api, module_tableview, qe-testadded, regression
ReporterEduardo Gomez
AssigneeSabil Rahim
Created2012-05-07T11:54:10.000+0000
Updated2012-07-11T13:38:04.000+0000

Description

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();

Attachments

FileDateSize
iOS_5_TableViewRows_SDK_1.8.2.jpg2012-05-07T11:54:11.000+000049675
iOS_5_TableViewRows_SDK_2.0.1.GA2.jpg2012-05-07T11:54:11.000+000046184

Comments

  1. Sabil Rahim 2012-05-29

  2. Max Stepanov 2012-05-30

    Side issue is fixed by PR https://github.com/appcelerator/titanium_mobile/pull/2288
  3. Michael Pettiford 2012-06-18

    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
  4. Anshu Mittal 2012-07-11

    Reopening to update labels.

JSON Source