Skip to content

Instantly share code, notes, and snippets.

@jpurcell
Created April 1, 2011 18:55
Show Gist options
  • Save jpurcell/898652 to your computer and use it in GitHub Desktop.
Save jpurcell/898652 to your computer and use it in GitHub Desktop.
Debugging for TableView scroll event with Titanium Developer.
var win = Ti.UI.currentWindow;
var data = [
{title:"Row 1",color:'#000',height:50},
{title:"Row 2",color:'#000',height:50},
{title:"Row 3",color:'#000',height:50},
{title:"Row 4",color:'#000',height:50},
{title:"Row 5",color:'#000',height:50},
{title:"Row 6",color:'#000',height:50},
{title:"Row 7",color:'#000',height:50},
{title:"Row 8",color:'#000',height:50},
{title:"Row 9",color:'#000',height:50},
{title:"Row 10",color:'#000',height:50},
{title:"Row 11",color:'#000',height:50},
{title:"Row 12",color:'#000',height:50},
{title:"Row 13",color:'#000',height:50},
{title:"Row 14",color:'#000',height:50},
{title:"Row 15",color:'#000',height:50},
{title:"Row 16",color:'#000',height:50},
{title:"Row 17",color:'#000',height:50},
{title:"Row 18",color:'#000',height:50},
{title:"Row 19",color:'#000',height:50},
{title:"Row 20",color:'#000',height:50},
{title:"Row 21",color:'#000',height:50}
];
var tableView = Ti.UI.createTableView({
data: data
});
win.add(tableView);
tableView.addEventListener('scroll',function(e){
Ti.API.info('first row: '+tableView.data[0].rows[e.firstVisibleItem].title);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment