Skip to content

Instantly share code, notes, and snippets.

@dagda1
Created August 9, 2011 08:23
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 dagda1/1133605 to your computer and use it in GitHub Desktop.
Save dagda1/1133605 to your computer and use it in GitHub Desktop.
do($ = jQuery) ->
$.fn.extend
readonlyDocumentsTable: (options) ->
$("tbody > tr:first", @).prepend($("<th class=\"clicker\">&nbsp;</th>"))
$("tbody > tr", @).not(':first').each (index, ele) ->
row = $(ele)
span = $("<span class=\"expand hand\"><img alt=\"Show Reports\" src=\"/img/buttons/expand-plus.gif\"\/><\/span>")
td = $("<td class=\"hand tac\">")
td.append(span)
td.click ->
uid = row.data("uid")
alert(uid)
row.prepend(td)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment