Created
January 6, 2012 23:34
-
-
Save jonalter/1573004 to your computer and use it in GitHub Desktop.
Update TableViewRows in place
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var win = Ti.UI.createWindow({ | |
| backgroundColor : '#fff' | |
| }); | |
| var rows = []; | |
| function createRow(){ | |
| var row1 = Ti.UI.createTableViewRow(); | |
| var label = Ti.UI.createLabel({ | |
| text: 'heyyyyyy', | |
| width: 'auto', | |
| height: 'auto', | |
| top: 5, | |
| left: 5 | |
| }); | |
| row1.add(label); | |
| row1.label = label; | |
| return row1; | |
| } | |
| for (var i = 0; i < 10; i++){ | |
| rows.push(createRow()); | |
| } | |
| var tableView = Ti.UI.createTableView(); | |
| tableView.data = rows; | |
| tableView.addEventListener('click', function(){ | |
| for (var i = 0; i < 10; i++){ | |
| rows[i].label.text = 'sup?'; | |
| } | |
| // rows[3].label.text = 'sup?'; | |
| }); | |
| win.add(tableView); | |
| win.open(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment