Created
July 22, 2010 10:58
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
// create table view data object | |
var data = []; | |
data[0] = Ti.UI.createTableViewRow({hasChild:true,title:'Row 1'}); | |
data[1] = Ti.UI.createTableViewRow({}); | |
data[2] = Ti.UI.createTableViewRow({hasCheck:true,title:'Row 3'}); | |
data[3] = Ti.UI.createTableViewRow({title:'Row 4'}); | |
var label = Ti.UI.createLabel({ | |
backgroundColor:'red', | |
font:{fontFamily:'sans-serif', fontSize:20}, | |
text:'Debug Mode' | |
}); | |
data[1].add(label); | |
// create table view | |
var tableview = Titanium.UI.createTableView({ | |
data:data | |
}); | |
// create table view event listener | |
tableview.addEventListener('click', function(e) | |
{ | |
// event data | |
var index = e.index; | |
var section = e.section; | |
var row = e.row; | |
var rowdata = e.rowData; | |
Titanium.UI.createAlertDialog({title:'Table View',message:'row ' + row + ' index ' + index + ' section ' + section + ' title ' + rowdata.title}).show(); | |
}); | |
// add table view to the window | |
Titanium.UI.currentWindow.add(tableview); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment