Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2968] iOS: TableViewRow.rightImage is attached to wrong row

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-10-27T15:42:54.000+0000
Affected Version/sn/a
Fix Version/sSprint 2011-31, Release 1.8.0
ComponentsiOS
Labelsrightimage, row, tableview
Reporteryu-ji
AssigneeStephen Tramer
Created2011-04-15T03:33:54.000+0000
Updated2011-10-27T15:42:54.000+0000

Description

I use rightImage at only for a part of TableViewRow.
TableViewRow.rightImage is attached to wrong row..

I coded following lines.

//example.js

var win = Ti.UI.currentWindow;
var tableView = Ti.UI.createTableView();

for(var i=0;i<20;i++) {
    var row = Ti.UI.createTableViewRow({
        isChecked: false
    });
    row.add(Ti.UI.createLabel({
        text: 'line' + (i + 1),
        left: 10
    }));
    tableView.appendRow(row);
}

tableView.addEventListener('click', function(e) {
    setTimeout(function() {
        if(e.row.isChecked) {
            e.row.rightImage = '';
            e.row.isChecked = false;
        }else{
            e.row.rightImage = 'images/check.png';
            e.row.isChecked = true;
        }
        // this is hack for not update rightImage
        e.row.title = e.row.title;
    }, 300);
});

win.add(tableView);
  1. Show this window.
  2. Click a row.(The rightImage attaches correct row.)
  3. Scroll down.
  4. Scroll up(and down, up, down, up..)
  5. The rightImage attaches to the line not clicked.

The rightImage has some other strange things..

Comments

  1. Anirudh Nagesh 2011-07-26

    Associated Helpdesk Ticket:

    appc.me/c/APP-647841
  2. Stephen Tramer 2011-07-27

    Will not be solved by any layout fixes. Table rows are "special".
  3. Vikramjeet Singh 2011-08-29

    Tested On: Mac OSX Lion TiMob: 1.8.0.v20110819142548 TiStud: 1.0.4.201108101535 Devices: iPhone 4 version 4.2.10 iPad2 version 4.3.5 iPod 3

JSON Source