Skip to content

Instantly share code, notes, and snippets.

@iotashan
Created September 2, 2012 06:44
Show Gist options
  • Select an option

  • Save iotashan/3595432 to your computer and use it in GitHub Desktop.

Select an option

Save iotashan/3595432 to your computer and use it in GitHub Desktop.
Here's a snippet from my app.js file
//
// include our reusable component
//
var BeerRow = require('BeerRow');
//
// create our rows
//
for (var i in beers) {
var newRow = new BeerRow(beers[i]);
newRow.view.addEventListener('click',function(e){
alert('You clicked on '+e.row.pullBeer().name);
});
tableRows.push(newRow.view);
}
//
// add our rows to the table
//
beerTable.data = tableRows;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment