Skip to content

Instantly share code, notes, and snippets.

@benmcnelly
Created October 18, 2011 00:04
Show Gist options
  • Save benmcnelly/1294261 to your computer and use it in GitHub Desktop.
Save benmcnelly/1294261 to your computer and use it in GitHub Desktop.
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
var win = Titanium.UI.createWindow({
title:'Places',
backgroundColor:'#333'
});
// Create XHR and load data
var xhr = Ti.Network.createHTTPClient();
var data;
xhr.open('GET', 'http://benmcnelly.com/delete/test.js',false);
xhr.send();
xhr.onload = function() {
data = eval('('+this.responseText+')');
//alert(data[2]);
}
// Create table view and add data
var tableview = Titanium.UI.createTableView({
data:data,
});
// add table view to main window
win.add(tableview);
win.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment