Skip to content

Instantly share code, notes, and snippets.

@willbailey
Created March 15, 2011 22:12
Show Gist options
  • Save willbailey/871617 to your computer and use it in GitHub Desktop.
Save willbailey/871617 to your computer and use it in GitHub Desktop.
// implement the table delegate protocol
var tableDelegate = (function() {
return {
sectionHeaderAtIndex: function() {
return null;
},
heightForSectionHeader: function(section) {
return 0;
},
heightForRowInSection: function(row, section) {
return 51;
},
numberOfSections: function() {
return 1;
},
numberOfRowsInSection: function() {
return 100000;
},
cellForRowInSection: function(row, section) {
return buildRandomRow(row)
},
};
})();
// configure a table with our delegate
var table = new Table({
height: '480px',
width: '320px',
style: {
background: '#ccc'
},
delegate: tableDelegate
});
var example = document.getElementById('example');
table.placeIn(example);
table.refresh();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment