Created
January 31, 2012 01:05
-
-
Save tauren/1707961 to your computer and use it in GitHub Desktop.
This file contains 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
renderTemplate: function(model, extras) { | |
var json = { | |
'orders': [ | |
{'id':'o12345','status':'Shipped','ordered':'2011-06-01'}, | |
{'id':'o34567','status':'Pending','ordered':'2011-07-01'}, | |
{'id':'o56789','status':'Shipped','ordered':'2011-08-01'} | |
] | |
}; | |
var tmpl = 'script#ordersTmpl'; | |
var html = Plates.bind($(tmpl).html(), json); | |
return html; | |
} | |
This file contains 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
<div id="orders"> | |
Order List goes here... | |
</div> | |
<script type="text/x-template" id="ordersTmpl"> | |
<table> | |
<tr class="orders"> | |
<td class="id">Order Id</td> | |
<td class="ordered">2011-10-20</td> | |
<td class="status">status</td> | |
<td class="actions"><a href="#" class="button">Order Again</a></td> | |
</tr> | |
</table> | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment