I can't change the image of my button that is inside the table view row
Here is my code:
var win = Ti.UI.createWindow({ backgroundColor : '#fff' }); var tableData = []; var toggle = false; for(var i = 0; i < 10; i++) { var row = Ti.UI.createTableViewRow(); var button = Ti.UI.createButton({ image : 'image/check.png', width : 100, height : 40, buttonid : i //our custom button property }); row.add(button); tableData.push(row); button.addEventListener('click', function(e) { if(toogle){ e.source.buttonid.img = 'image/check.png'; toogle = false; }else{ e.source.buttonid.img = 'image/uncheck.png'; toggle = true; } }); } var tableView = Ti.UI.createTableView({ data : tableData }); win.add(tableView);