Created
August 24, 2009 19:07
-
-
Save davidhemphill/174072 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
window.onload = function() | |
{ | |
var messages = {}; | |
var xhr = Titanium.Network.createHTTPClient(); | |
xhr.onload = function() | |
{ | |
// convert the response JSON text into a JavaScript object | |
var json = eval('(' + this.responseText + ')'); | |
// pull out the rows property which should return an array of rows | |
var rows = json['rows']; | |
// Figure out how to make the title show up in the table row | |
for (var c=0;c<rows.length;c++) | |
{ | |
messages[rows[c].title]=rows[c].title; | |
} | |
} | |
xhr.open("GET", "http://lebanonfamilychurch.org/mobile/messages/"); | |
xhr.send(null); | |
var optionSection = Titanium.UI.iPhone.createGroupedSection({header:'Message Series', type:'option', data:rows}); | |
// create the grouped view | |
var groupedView = Titanium.UI.iPhone.createGroupedView(); | |
groupedView.addSection(optionSection); | |
// add view to the window | |
Titanium.UI.currentWindow.addView(groupedView); | |
// show view | |
Titanium.UI.currentWindow.showView(groupedView); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment