[TIMOB-3751] iOS: Dynamically change the backgroundImage of a TableViewRow
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-02-11T21:54:11.000+0000 |
Affected Version/s | Release 1.6.0 M10, Release 2.0.1, Release 3.1.0 |
Fix Version/s | Release 3.2.0 |
Components | iOS |
Labels | module_tableviewrow, qe-closed-3.2.2, qe-testadded |
Reporter | Pedro Enrique |
Assignee | Ingo Muschenetz |
Created | 2011-04-27T09:02:46.000+0000 |
Updated | 2014-03-14T06:46:57.000+0000 |
Description
This code supposedly changes the background image of the clicked row:
var window = Ti.UI.createWindow({
backgroundColor:'white'
});
var myTable = Titanium.UI.createTableView({});
for (var i = 0; i < 40; i++) {
var row = Ti.UI.createTableViewRow({
height:30,color:"white"
});
row.backgroundImage='KS_nav_views.png';
myTable.appendRow(row);
}
var sections = myTable.data;
var section = sections[0];
myTable.addEventListener('click', function(e){
alert(e.row);
e.row.backgroundImage='KS_nav_ui.png';
});
window.add(myTable);
window.open({modal:true});
But it does nothing.
There is a Helpdesk ticket that encounter this: http://support.appcelerator.com/tickets/APP-126267/homepage
What this ticket is asking, is not to change the bg image, but to remove it. That could be a feature request as well.
Another ticket with this problem: http://support-admin.appcelerator.com/display/APP-637384 Also, CDC is waiting on this functionality. The table needs to be triggered to redraw when the backgroundImage property is modified.
Fixed spelling error in title.
Tested with 2.0.1GA2 on the iOS simulator, issue still reproducible. I have noticed that if you click on the same row twice, it will change the image, but it should work the first time.
Issue exist with release 3.1.0.if you click on the same row twice, it will change the image, Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 iOS iPhone Simulator: iOS SDK version: 6.0
This issue can't be reproduced with TISDK 3.2 or higher. Therefore, marking it as resolved.
Verified the fix, hence closing the issue. Environment used: Device : iPhone 5s , iOS version : 7.1 SDK: 3.2.2.v20140221161255 CLI version : 3.2.1 OS : MAC OSX 10.9 Alloy: 1.3.1 ACS: 1.0.14 npm:1.3.2 Appcelerator Studio, build: 3.2.2.201402280732 titanium-code-processor: 1.1.0 XCode : 5.1 Beta 5