[AC-2792] "TableView" issue - row reference in "click" event listener is broken when "TableView" is added to the window with layout property set to "vertical"
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-12-23T03:46:12.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | n/a |
Reporter | Ivan Skugor |
Assignee | Paul Dowsett |
Created | 2011-10-18T08:20:03.000+0000 |
Updated | 2016-03-08T07:47:42.000+0000 |
Description
Here is an example that demonstrates the issue:
var win = Ti.UI.createWindow({
modal: true,
backgroundColor: '#000',
layout: 'vertical'
});
var tableView = Ti.UI.createTableView({
data: [ { title: 'Toogle row 1' }, { title: 'Toogle row 2' } ]
})
tableView.addEventListener('click', function(e) {
Ti.API.debug(e.row);
e.row.hasCheck = !e.row.hasCheck;
if (e.row.hasCheck) {
e.row.backgroundColor = '#999';
}
else {
e.row.backgroundColor = '#000';
}
Ti.API.debug(e.row.hasCheck);
Ti.API.debug(e.row.backgroundColor);
});
win.add(tableView);
win.open();
Comment out window's layout property and see the difference. The difference should be that example works fine without layout property set to "vertical", "horizontal" seems to work fine.
Output seems ok, "e.row" produces same string every time, "hasCheck" and "backgroundColor" property is changed, but it isn't reflected on actual table view row (except for the first click).
Why is this issue not being accepted? Did I miss something to mention, description is not good, etc.? :)
I tested this with latest 1.9 SDK and issue does not exists! Case closed. :)
Thank you for reporting back, Ivan. Much appreciated! :)