Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2810] Changing table row BG color doesn't redisplay with new color

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T02:00:08.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.6.0 M05
ComponentsiOS
Labelsbackgroundcolor, ios, release-1.6.0, reported-1.5.1, rplist, tableviewrow
ReporterStephen Tramer
AssigneeStephen Tramer
Created2011-04-15T03:30:08.000+0000
Updated2011-04-17T02:00:08.000+0000

Description

Example code:

var win = Ti.UI.createWindow({backgroundColor:"white"});

// create table view data object
var rows = [
    Ti.UI.createTableViewRow({title:'Row 1'}),
    Ti.UI.createTableViewRow({title:'Row 2'}),
    Ti.UI.createTableViewRow({title:'Row 3'}),
    Ti.UI.createTableViewRow({title:'Row 4'})
];

var tableview = Titanium.UI.createTableView({
    data:rows
});

var tableRowSelect = function(rows, index, tableView) {
 for (var i=0;i<rows.length;i++) {
   Ti.API.log('Checking row index '+i);
   if(i == index) {
     Ti.API.log('Selected');
     rows[i].backgroundColor = '#fff';
   } else {
     Ti.API.log('Deselected');
     rows[i].backgroundColor = '#d6d6d6';
   }
 }
};

tableview.addEventListener('click', function(e) {
       tableRowSelect(rows, e.index, tableview);
});

win.add(tableview);
win.open();

Comments

  1. Jeff Haynie 2011-04-15

    (from [88f08605a940503f889a5287bc0f09af2e5c9a22]) [#2810 state:fixed-in-qa] Force table row redraw on BG color change. https://github.com/appcelerator/titanium_mobile/commit/88f08605a940503f889a5287bc0f09af2e5c9a22"> https://github.com/appcelerator/titanium_mobile/commit/88f08605a940...

  2. Jeff Haynie 2011-04-15

    (from [8e8e0481abb36fc73889692da3e815d5d0dd194d]) [#2810 state:fixed-in-qa] Force table row redraw on BG color change. https://github.com/appcelerator/titanium_mobile/commit/8e8e0481abb36fc73889692da3e815d5d0dd194d"> https://github.com/appcelerator/titanium_mobile/commit/8e8e0481abb3...

  3. Thomas Huelbert 2011-04-15

    [INFO] Titanium SDK version: 1.5.2 (01/12/11 16:50 8e8e048) 4GT ipod touch (4.2.1), 3gt ipod (4.0.1) iphone 3 (3.1.3). [INFO] Titanium SDK version: 1.6.0 (01/12/11 16:49 1b81d26) 4GT ipod touch (4.2.1), 3gt ipod (4.0.1) iphone 3 (3.1.3).

JSON Source