Steps To Reproduce:
1. Use the code below in your app.js:
var win = Ti.UI.createWindow({backgroundColor:'black'});
var tableData = [ {title: 'Apples'}, {title: 'Bananas'}, {title: 'Carrots'}, {title: 'Potatoes'} ];
var table = Ti.UI.createTableView({
data: tableData
});
table.addEventListener('click', function(e){
alert(e.rowData);
});
win.add(table);
win.open();
2. Build for windows device/emulator.
3. After the app launches click on any row.
Actual Result:
1. The alert shows [object object] rather than row data.
Expected Result:
1. The alert should the row value.
[~lchoudhary], what exactly do you mean by "row value"? Do you expect it returns string like "\{title: 'Bananas'\}"? Currently
e.rowData
returns JavaScript dictionary object according to [Titanium API doc](http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TableView-event-click). So for example when youalert(e.rowData)
, it should show it is anObject
. You can dump its actual value by string when you useJSON.stringify
.[~kota], Ok thanks for clarifying, I get
. I opened the ticket because on android the same code returns the string like
& I was thinking we should have parity across platforms ?
[~lchoudhary], thanks for information. After discussion with Windows team we come up with conclusion that we want it to match with Titanium iOS behavior because Titanium iOS & Windows uses same JavaScript engine (JavaScriptCore). We'll work on that.
[~kota] [~lchoudhary] Looks to me like this isn't something every platform does the same. I just tried on iOS and got the following:
[~cwilliams] [~lchoudhary] Thanks for clarification. I would say this behavior on Titanium Windows is valid where we are returning "properties of the row" across platform correctly according to Titanium API doc, using different internal representation. You can check actual values by string using
JSON.stringify
.Closing