Created
February 1, 2013 03:45
-
-
Save mikeymckay/4689030 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
@$el.html " | |
Value used for grouping: | |
<select id='groupBy'> | |
#{ | |
_.map propertiesToGroupBy, (value,key) -> | |
"<option #{if key is groupBy then "selected='true'" else ''}> | |
#{key} | |
</option>" | |
} | |
</select> | |
<table id='results' class='tablesorter'> | |
<thead> | |
<th>#{groupBy}</th> | |
#{ | |
_.map(dates, (date) -> | |
"<th>#{date}</th>" | |
).join("") | |
} | |
</thead> | |
<tbody> | |
#{ | |
_.map(tableRows, (dataForDates, leftColumn) -> | |
"<tr> | |
<td>#{leftColumn}</td> | |
#{ | |
_.map(dates, (date) -> | |
"<td> | |
#{ | |
if dataForDates[date] | |
" | |
<button class='sortValue' onClick='$(this).siblings().toggle()'>#{dataForDates[date].length}</button> | |
<div style='display:none'> | |
#{dataForDates[date].join("")} | |
</div> | |
" | |
else | |
"" | |
} | |
</td>" | |
).join("") | |
} | |
</tr>" | |
).join("") | |
} | |
</tbody> | |
</table> | |
" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment