Blame view

www/js/tablesorter/tests/checkbox.html 1.64 KB
ef60cd4d   Administrator   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
  <!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>