Hi everyone, I'm using Titanium 2.1.1, Android 4.1 on Windows 7. I'm trying to add a row to a tableView as the "return" event is fired, but when i add a new row it changes the title of the previous row and then displays the same title for each row. That's my code:
var win = Titanium.UI.currentWindow; var textField = Ti.UI.createTextField({ borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED, color: '#336699', top: 350, width: Ti.Platform.displayCaps.platformWidth, height: Titanium.UI.SIZE, }); win.add(textField); var tableView = Ti.UI.createTableView({ top: 0, width:Ti.Platform.displayCaps.platformWidth, height: 350*Ti.Platform.displayCaps.platformHeight/480, }); /***** Beginning of the event******/ textField.addEventListener('return',function(e){ var row = Ti.UI.createTableViewRow({ className: 'row', objName: 'row', touchEnabled: true, height: Titanium.UI.SIZE, width : Ti.Platform.displayCaps.platformWidth, }); row.title = this.value; tableView.appendRow(row); this.value =''; }); /**** End of the event*****/ win.add(tableView);Please did i do something wrong?
Your Answer
This question has been locked and cannot accept new answers.