Skip to content

Instantly share code, notes, and snippets.

@ryugoo
Created April 1, 2012 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryugoo/2276657 to your computer and use it in GitHub Desktop.
Save ryugoo/2276657 to your computer and use it in GitHub Desktop.
TableView Kusha Concept Code, Challenge No WARN (Success!).
/**
* Titanium Mobile Continuous Build TableView Test Program
* Update : 2012/04/15
* Aurhor : @ryugoo_
* http://imthinker.net/
*/
// Define Application Namespace
var TiCIB = {};
// Immediate Function
(function() {
function ApplicationRow(times) {
// Create Row
function createTableViewRow(curNum) {
// Prepare Label
var label = Ti.UI.createLabel({
// Kusha Test for Label
width : Ti.UI.SIZE,
height : Ti.UI.FILL,
backgroundColor : "#CCCCCC",
top : 0,
left : 10,
text : "Data Number is " + curNum
});
// Row Wrap View
var rowView = Ti.UI.createView({
height : 44,
width : Ti.UI.FILL,
backgroundColor : "transparent"
});
rowView.add(label);
// Prepare Table View Row
var row = Ti.UI.createTableViewRow({
width : Ti.UI.SIZE,
className : "nowarn",
visible : true
});
row.add(rowView);
return row;
}
// Data Wrapper
var dataWrap = [];
var i;
for( i = 0; i < times; i++) {
dataWrap.push(createTableViewRow(i));
}
// Return Data Wrapper
return dataWrap;
}
function ApplicationWindow() {
// Window
var win = Ti.UI.createWindow({
tabBarHidden : true,
backgroundColor : "#EFEFEF",
});
// Master View
var master = Ti.UI.createView({
backgroundColor : "#EFEFEF",
width : Ti.UI.FILL,
height : Ti.UI.FILL
});
// Table
var data = new ApplicationRow(2);
var table = Ti.UI.createTableView({
height : Ti.UI.FILL,
width : Ti.UI.FILL,
data : data
});
// Append Objects
master.add(table);
win.add(master);
return win;
}
function ApplicationTab() {
var tabGroup = Ti.UI.createTabGroup();
tabGroup.addTab(Ti.UI.createTab({
title : "Let's No WARN 2.1.0 !",
window : new ApplicationWindow()
}));
return tabGroup;
}
TiCIB.tabGroup = new ApplicationTab();
TiCIB.tabGroup.open();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment