Problem Description
When I press a label in first row of table view, it is returning [object TiUITableViewRow] instead of [object TiUILabel].
All other rows, it is returning correct label [object TiUILabel].
What could be a reason for this issue happening for only first row?
This issue happens only with 3.1.3GA version when I compiled for iPhone/iPad.
Test case
var win = Ti.UI.createWindow({
});
function makeRow () {
var row = Ti.UI.createTableViewRow({
height:45
});
row.add(Ti.UI.createLabel({
text:"label",
top:0,
left:15,
height:30,
touchenabled: false,
}));
return row;
}
var table1 = Ti.UI.createTableView({
top:60,
left:0,
right:20,
bottom:40,
});
function refreshItemnames(){
for(var i=0;i<25;i++)
table1.appendRow (makeRow());
}
refreshItemnames();
table1.addEventListener('click', function(e) {
Ti.API.info("e.row =" + e.row + ", e.source = " + e.source + ", e"+e);
});
win.add(table1);
win.open();
Steps to reproduce
1. Create a new mobile project for iOS7, with 3.1.3
2. Paste the testcase into app.js
3. Run in the simulator
4. Click on the first row.
5. Click on the second row.
6. Check console, you will see the difference, even if you created the two rows in the same way.
Extra info
Log when 1YY label is clicked in TableView:
First row output:
[INFO] e.row =[object TiUITableViewRow], e.source = [object TiUILabel]
Second or any other row is clicked:
[INFO] e.row =[object TiUITableViewRow], e.source = [object TiUITableViewRow]
Hi Murali, Your test case contains a lot of extra code to demonstrate this issue, have you been able to reproduce this with the bare minimum code? if so can you provide the sample for this? Thanks.
Hi Jamie, I removed further code and provided minimal code to reproduce this issue. It is attached new "app.js" file which is uploaded. Log when YY label is clicked in TableView: First row output: [INFO] e.row =[object TiUITableViewRow], e.source = [object TiUITableViewRow] Second or any other row is clicked: [INFO] e.row =[object TiUITableViewRow], e.source = [object TiUILabel]