Created
October 18, 2011 00:04
-
-
Save benmcnelly/1294261 to your computer and use it in GitHub Desktop.
This file contains 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
// 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