Skip to content

Instantly share code, notes, and snippets.

@iskugor
Created April 18, 2012 14:00
Show Gist options
  • Save iskugor/2413774 to your computer and use it in GitHub Desktop.
Save iskugor/2413774 to your computer and use it in GitHub Desktop.
Titanium "TableView" data property magic
var win = Ti.UI.createWindow({
backgroundColor: '#0f0',
navBarHidden: true
});
var table = Ti.UI.createTableView({
backgroundColor: '#f00'
});
var rows = [];
for (var i = 0; i < 100; ++i) {
rows[i] = Ti.UI.createTableViewRow({ title: 'Row ' + i });
}
table.data = rows;
Ti.API.info(rows.length); //100
Ti.API.info(table.data.length); //1
win.add(table);
win.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment