Skip to content

Instantly share code, notes, and snippets.

@gmoeck
Created June 25, 2011 17:52
Show Gist options
  • Save gmoeck/1046710 to your computer and use it in GitHub Desktop.
Save gmoeck/1046710 to your computer and use it in GitHub Desktop.
table_example.handlebars
<table>
<tbody tabindex="-1" id="sc201" class="">
<tr tabindex="-1" id="sc210" class="" style="">
<td tabindex="-1" id="sc214" class="" style=""><span tabindex="-1" id="sc216" class="" style="">something</span></td>
<td tabindex="-1" id="sc220" class="" style=""><span tabindex="-1" id="sc221" class="" style="">new</span></td>
</tr>
<tr tabindex="-1" id="sc225" class="" style="">
<td tabindex="-1" id="sc228" class="" style=""><span tabindex="-1" id="sc229" class="" style="">something</span></td>
<td tabindex="-1" id="sc232" class="" style=""><span tabindex="-1" id="sc233" class="" style="">else</span></td>
</tr>
</tbody>
</table>
TableExample.TBodyView = SC.TemplateCollectionView.extend({
tagName: 'tbody',
content: [['something', 'new'],['something', 'else']],
itemView: SC.TemplateCollectionView.extend({
tagName: 'tr',
itemView: SC.TemplateView.extend({
tagName: 'td',
templateName: 'column_view',
})
})
});
<table>
{{collection TableExample.TBodyView}}
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment