Titanium JIRA Archive
Appcelerator Community (AC)

[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 Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionFixed
Resolution Date2011-12-23T03:46:12.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterIvan Skugor
AssigneePaul Dowsett
Created2011-10-18T08:20:03.000+0000
Updated2016-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).

Comments

  1. Ivan Skugor 2011-10-25

    Why is this issue not being accepted? Did I miss something to mention, description is not good, etc.? :)
  2. Ivan Skugor 2011-12-22

    I tested this with latest 1.9 SDK and issue does not exists! Case closed. :)
  3. Paul Dowsett 2011-12-23

    Thank you for reporting back, Ivan. Much appreciated! :)

JSON Source