Detail property of TableViewRow 'click' event does not work?
Hi,
as described in docs (http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.TableViewRow-object) a TableViewRow provides a detail
property within the click
event object. It should be a boolean to indicate if the right area was clicked.
But this property is always false, wherever I clicked. Tried it on Android and iPhone simulator.
Can someone help me or is this a bug?
Thanks in advance
2 Answers
-
You have to add a click listener to the tableview object (not the row), then check for the event.detail boolean ex: if(e.detail == true)
-
You have to Tableview event listener instead of row, and check whether the corresponding row is clicked or not using index(e.index) or by creating temporary property(test) like,
var data = [{title:"Row 1",test:"var1"},{title:"Row 2",test:"var2"}];
var table = Titanium.UI.createTableView({data:data});
win.add(table);and in event listener find each row individually using (e.Rowdata.test=="var1")or(e.Rowdata.test=="var2")
in this way TableViewRow 'click' event can be achieved.