Skip to content

Instantly share code, notes, and snippets.

@ricardoalcocer
Created November 23, 2012 19:36
Show Gist options
  • Save ricardoalcocer/4136985 to your computer and use it in GitHub Desktop.
Save ricardoalcocer/4136985 to your computer and use it in GitHub Desktop.
Basic Alloy : Static TableView Handling
function showItems(e) {
Ti.API.info(e.rowData.itemName);
}
$.win.open();
"#container": {
backgroundColor:"white"
},
"#itemName": {
width: Ti.UI.SIZE,
height: Ti.UI.SIZE,
color: "#000",
left: 0
},
"#row":{
height: "40dp",
hasChild: true
}
<Alloy>
<Window id="win">
<TableView id="itemsList" onClick="showItems">
<TableViewRow id="row" rowId="1" itemName="Test1">
<Label id="itemName">Test 1</Label>
</TableViewRow>
<TableViewRow id="row" rowId="2" itemName="Test2">
<Label id="itemName">Test 2</Label>
</TableViewRow>
<TableViewRow id="row" rowId="3" itemName="Test3">
<Label id="itemName">Test 3</Label>
</TableViewRow>
<TableViewRow id="row" rowId="4" itemName="Test4">
<Label id="itemName">Test 4</Label>
</TableViewRow>
<TableViewRow id="row" rowId="5" itemName="Test5">
<Label id="itemName">Test 5</Label>
</TableViewRow>
</TableView>
</Window>
</Alloy>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment