science-ation/js/tablesorter/tests/checkbox.html
james 69eb9a2817 add the tablesort jquery plugin (jacob forgot it)
needs to be trimmed back theres wxtra crap in the folder
2010-03-30 23:33:27 +00:00

84 lines
1.7 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>tablesorter 2.0-dev demo, multi column sorting</title>
<style type="text/css">@import "assets/css/default.css";</style>
<script type="text/javascript" src="../jquery-latest.js"></script>
<script type="text/javascript" src="../jquery.tablesorter.js"></script>
<script type="text/javascript">
$(function() {
// add ie checkbox widget
$.tablesorter.addWidget({
id: "iecheckboxes",
format: function(table) {
if($.browser.msie) {
if(!this.init) {
$(":checkbox",table).change(function() { this.checkedState = this.checked});
this.init = true;
}
$(":checkbox",table).each(function() {
$(this).attr("checked",this.checkedState);
});
}
}
});
$("table").tablesorter({widgets: ['iecheckboxes']})
$("#fillup").click(function() {
$("table tbody").append(
'<tr><td>Student01</td><td>Languages</td><td>male</td><td>80</td><td>70</td><td>75</td><td><form><input type="checkbox" checked=""/></form></td></tr>'
);
//$("table").trigger("update");
});
});
</script>
</head>
<body>
<a href="#" id="fillup">fill up</a>
<table id="large" cellspacing="0">
<thead>
<tr>
<th>Name</th>
<th>Major</th>
<th>Sex</th>
<th>English</th>
<th>Japanese</th>
<th>Calculus</th>
<th>Geometry</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Major</th>
<th>Sex</th>
<th>English</th>
<th>Japanese</th>
<th>Calculus</th>
<th>Geometry</th>
</tr>
</tfoot>
<tbody>
</tbody>
</table>
</body>
</html>