Skip to content

Instantly share code, notes, and snippets.

@tripitakit
Last active December 28, 2015 00:49
Show Gist options
  • Save tripitakit/7416540 to your computer and use it in GitHub Desktop.
Save tripitakit/7416540 to your computer and use it in GitHub Desktop.
A functional rewrite of an Appcelerator Titanium iOS tableView test code which displays four tables with combination of moving/moveable/editing/editable properties to test their effects on rows' appearance and behavior.
(function(win) {
["moving editing",
"moving editable",
"moveable editing",
"moveable editable"
].map(function(test){
var table = { headerTitle: test };
test.split(" ").map(function(property){
table[property] = true;
});
return table;
}).map(function(table) {
table.data = ['Alpha', 'Beta','Gamma'].map(function(row_title) {
return {title: row_title}
});
table.height = 150;
table.top = 40;
return(table);
}).map(function(table) {
return Ti.UI.createTableView(table);
}).map(function(tableView){
win.add(tableView);
});
win.open();
})(Ti.UI.createWindow({
backgroundColor:'#fff',
layout:'vertical',
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment