Skip to content

Instantly share code, notes, and snippets.

@nmerouze
Created January 4, 2010 15:30
Show Gist options
  • Save nmerouze/268587 to your computer and use it in GitHub Desktop.
Save nmerouze/268587 to your computer and use it in GitHub Desktop.
$(function() {
$.getJSON("http://search.twitter.com/search.json?&q=appcelerator&rpp=10&callback=?", function(json) {
var data = _.map(json.results, function(item) {
return { text:item.text, image:item.profile_image_url };
});
});
});
$(function() {
$.getJSON("http://search.twitter.com/search.json?&q=appcelerator&rpp=10&callback=?", function(json) {
var data = _.map(json.results, function(item) {
return { text:item.text, image:item.profile_image_url };
});
var template = {
selectedBackgroundColor:"#111",
rowHeight:50,
layout:[
{ type:"text", name:"text", fontSize:10, fontWeight:"normal", color:"#999", top:5, left:50 },
{ type:"image", name:"image", width:40, height:40, top:5, left:5 }
]
};
});
});
$(function() {
$.getJSON("http://search.twitter.com/search.json?&q=appcelerator&rpp=10&callback=?", function(json) {
var data = _.map(json.results, function(item) {
return { text:item.text, image:item.profile_image_url };
});
var template = {
selectedBackgroundColor:"#111",
rowHeight:50,
layout:[
{ type:"text", name:"text", fontSize:10, fontWeight:"normal", color:"#999", top:5, left:50 },
{ type:"image", name:"image", width:40, height:40, top:5, left:5 }
]
};
var tableView = Titanium.UI.createTableView({
backgroundColor:"transparent",
borderColor:"#333",
template:template,
data:data
}, function(eventObject) {});
});
});
$(function() {
$.getJSON("http://search.twitter.com/search.json?&q=appcelerator&rpp=10&callback=?", function(json) {
var data = _.map(json.results, function(item) {
return { text:item.text, image:item.profile_image_url };
});
var template = {
selectedBackgroundColor:"#111",
rowHeight:50,
layout:[
{ type:"text", name:"text", fontSize:10, fontWeight:"normal", color:"#999", top:5, left:50 },
{ type:"image", name:"image", width:40, height:40, top:5, left:5 }
]
};
var tableView = Titanium.UI.createTableView({
backgroundColor:"transparent",
borderColor:"#333",
template:template,
data:data
}, function(eventObject) {});
Titanium.UI.currentWindow.addView(tableView);
Titanium.UI.currentWindow.showView(tableView);
});
});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/underscore.js"></script>
<script type="text/javascript" src="index.js"></script>
</head>
<body></body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment