Created
April 17, 2011 18:24
-
-
Save wookiehangover/924315 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
{ | |
'groups': [ | |
{ | |
'id': 1, | |
'name': 'jQuery Team', | |
'children': [ | |
{ | |
'id': 2, | |
'name': 'John Resig' | |
}, | |
{ | |
'id': 3, | |
'name': 'Dave Methvin' | |
}, | |
{ | |
'id': 4, | |
'name': 'Yehuda Katz' | |
}, | |
{ | |
'id': 5, | |
'name': 'Julian Aubourg' | |
}, | |
{ | |
'id': 6, | |
'name': 'Anton Matzneller' | |
} | |
] | |
}, | |
{ | |
'id': 7, | |
'name': 'jQuery UI Team', | |
'children': [ | |
{ | |
'id': 8, | |
'name': 'Richard Worth' | |
}, | |
{ | |
'id': 9, | |
'name': 'Scott González' | |
}, | |
{ | |
'id': 10, | |
'name': 'Jörn Zaefferer' | |
}, | |
{ | |
'id': 11, | |
'name': 'Todd Parker' | |
}, | |
{ | |
'id': 12, | |
'name': 'Adam Sontag' | |
} | |
] | |
} | |
] | |
} |
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
<script id="category-template" type="text/x-jquery-tmpl"> | |
{{if groups.length}} | |
{{each groups}} | |
<li data-catId="${id}"> | |
{{tmpl($value) '#category-content-template'}} | |
{{if children}} | |
<ul class="category-child" data-catId="${id}"> | |
{{each children}} | |
<li data-catId="${id}">{{tmpl($value) '#category-content-template'}}</li> | |
{{/each}} | |
</ul> | |
{{/if}} | |
</li> | |
{{/each}} | |
{{else}} | |
<li>No categories available.</li> | |
{{/if}} | |
</script> | |
<script id="category-content-template" type="text/x-jquery-tmpl"> | |
<a href="#">${name}</a> | |
{{if children}} | |
<span class="ui-li-count">${children.length}</span> | |
{{/if}} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment