Skip to content

Instantly share code, notes, and snippets.

@RainerBlessing
Created November 13, 2011 11:37
Show Gist options
  • Save RainerBlessing/1362012 to your computer and use it in GitHub Desktop.
Save RainerBlessing/1362012 to your computer and use it in GitHub Desktop.
Sproutcore 2.0 and Tables
# HTML
<script type="text/html">
<table>
<tr><th>Column One</th><th>Column Two</th></tr>
{{#collection App.CollectionView tagName="tbody"}}
<td>{{content.column_one}}</td><td>{{content.column_two}}</td>
{{/collection}}
</table>
</script>
#JavaScript
var App = SC.Application.create();
App.CollectionView = SC.CollectionView.extend({
content: [{ column_one: 'one', column_two: 'two'}],
itemViewClass: SC.View.extend({
tagName: 'tr'
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment