Hi, If I'm not wrong the index property doesn't exists on Android. Is there any other alternative to get something similar on Android ? I need fast access to row like in IOS. Regards
2 Answers
Armindo,
Is your table already defined with entries? If so, you can get the index by adding an EventListener.
var tbl_data = [ {title:'Row 1' {title:'Row 2' ]; var table = Ti.UI.createTableView({data:tbl_data}); table.addEventListener('click',function(e){ alert('You clicked row '+e.index); }If you're getting data from a database, you could assign the primary key from the database as the id for the table row:
while(rs.isValidRow()) { var tblRow = Ti.UI.createTableViewRow({ minRowHeight:40, id: rs.fieldByName('service_id') });
Hi Armindo,
Can you explain that in a bit more detail with example?
Your Answer
Think you can help? Login to answer this question!