Skip to content

Instantly share code, notes, and snippets.

@mikeymckay
Created February 1, 2013 03:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeymckay/4689030 to your computer and use it in GitHub Desktop.
Save mikeymckay/4689030 to your computer and use it in GitHub Desktop.
@$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