As shown in the following code, I am trying to use the data of a tableview when a row in the tableview is clicked. It will open a new page and display the corresponding data contained in the row. Like a contact book.
When running in iOS Simulator, the d
works well and I can get the string. However, when running in Android Emulator, the d
turns out to be undefined when I print it by Ti.API.info. In both case the t
works well.
Could anyone show me how I can fix the problem with Android? Thanks!
var tableview = Titanium.UI.createTableView({ data : data, }); tableview.addEventListener('click', function(e) { if (e.row.title) { var t = e.row.title; var d = e.row.detail; } });
data
is parsed from a JSON like this:[ { "title": "my name", "detail": "my detail"}, ]