select all/none columns with a link click
[MojoFacets.git] / 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>