Hi !
I try to create elements and eventListeners in loop "for". But the system keeps the last event of the loop and has applied all items.
function parseData(jsonData){ var tableData = []; var section = []; for(i=0; i<3;i++){ section[i] = Ti.UI.createTableViewSection({ headerTitle: "nameLink"}); section[i].add(Ti.UI.createTableViewRow({ title: "enabledLink", backgroundColor: "green", hasChild:true})); //click : open new windows section[i].addEventListener('click', function(e) { window.containingTab.open(Ti.UI.createWindow({ title: L('test: '+i), backgroundColor: 'white', });); }); tableData.push(section[i]); } table.data= tableData; }How do I obtain a different window for each element/event ?