var list = [{title:"Label Demo", url:""},
{title:"Button Demo", url:"SecondView.js"},
{title:"Switch Demo", url:""},
{title:"ImageView Demo", url:"imageview.js"}];
var tableData = [];
for (var i=0; i
{title:"Button Demo", url:"SecondView.js"},
{title:"Switch Demo", url:""},
{title:"ImageView Demo", url:"imageview.js"}];
var tableData = [];
for (var i=0; i
- < list.length; i++){
var row = Ti.UI.createTableViewRow({
className:'forumEvent', // used to improve table performance
//selectedBackgroundColor:'white',
rowIndex:i, // custom property, useful for determining the row during events
height:70,
backgroundSelectedColor:'#ccc'
});
var labelUserName = Ti.UI.createLabel({
color:'#333',
font:{fontFamily:'Roboto', fontSize:18},
text:list[i].title,
left:20, top: 15,
width:200, height: 40
});
row.add(labelUserName);
tableData.push(row);
}
var tableView = Ti.UI.createTableView({
backgroundColor:'white',
separatorColor:'#999',
data:tableData
});
tableView.addEventListener("click", function(e){
Ti.API.info("clicked at row " + e.rowData.rowIndex);
var win = Ti.UI.createWindow({
url:list[e.rowData.rowIndex].url,
title: list[e.rowData.rowIndex].title,
myVar: list[e.rowData.rowIndex].title,
backgroundColor:"white"
});
win.open();
})
self.add(tableView);
No comments:
Post a Comment