select all/none columns with a link click
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 4 Apr 2010 19:35:10 +0000 (21:35 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 4 Apr 2010 19:35:10 +0000 (21:35 +0200)
templates/data/columns.html.ep

index 13548eb..ad6a79b 100644 (file)
@@ -12,6 +12,10 @@ $(function() {
        $("#sortable").sortable();
        $("#sortable").disableSelection();
 });
+
+function all_checkboxes(checked) {
+    $("input[type='checkbox']:not([disabled='disabled'])").attr('checked', checked);
+}
 </script>
 
 
@@ -21,6 +25,9 @@ $(function() {
 
 <form method=post action=/data/table >
 
+<a href="#" onClick="all_checkboxes(true); return false;">all</a>
+<a href="#" onClick="all_checkboxes(false); return false;">none</a>
+
 <ul id="sortable">
 % foreach my $n ( @$columns ) {
 <li>