Created
March 15, 2011 22:12
-
-
Save willbailey/871617 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// 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