-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrowSort_disabled.html
153 lines (145 loc) · 4.41 KB
/
rowSort_disabled.html
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>jquery.rowsorter.js</title>
</head>
<body>
<style>
.unSecable{-o-user-select: none;-webkit-user-select: none;-moz-user-select: -moz-none;-khtml-user-select: none;-ms-user-select: none;user-select: none;}
div.work {
float: left;
width: 420px;
height: 400px;
margin: 20px 0 0 20px;
overflow: auto;
}
pre {
float: left;
margin-top: 20px;
padding: 8px;
width: 490px;
height: 400px;
overflow: auto;
background: #eee;
font-family: consolas, "courier new";
font-size: 14px;
}
#log {
display: inline-block;
margin-top: 20px;
padding: 5px;
width: 390px;
background: #eee;
}
table {width: 400px; font-size: 14px; font-family: tahoma, arial, sans-serif;}
table thead th {background-color: #ccc; padding: 5px 8px;}
table td {background-color: #ddd; padding: 5px 8px;}
table.sorting-table {cursor: move;}
table tr.sorting-row td {background-color: #8b8;}
table td.sorter {background-color: #f80; width: 10px; cursor: move;}
table tr.nodrag td.sorter {background-color: #eee; cursor: default;}
</style>
<div class="work">
<table>
<thead>
<tr>
<th colspan="4">Handler Option</th>
</tr>
</thead>
<tbody id="table1">
<tr>
<td class="sorter"></td>
<td>Row 1</td>
<td>Sample Content 1</td>
<td>Sample Content 1</td>
</tr>
<tr>
<td class="sorter"></td>
<td>Row 2</td>
<td>Sample Content 2</td>
<td>Sample Content 2</td>
</tr>
<tr class="nodrag">
<td class="sorter"></td>
<td>Row 3</td>
<td>Sample Content 3</td>
<td>Sample Content 3</td>
</tr>
<tr>
<td class="sorter"></td>
<td>Row 4</td>
<td>Sample Content 4</td>
<td>Sample Content 4</td>
</tr>
<tr>
<td class="sorter"></td>
<td>Row 5</td>
<td>Sample Content 5</td>
<td>Sample Content 5</td>
</tr>
</tbody>
</table>
<code id="log"></code>
</div>
<pre>
<table id="table1">
<thead>
<tr>
<th colspan="4">Basic Sorting</th>
</tr>
</thead>
<tbody>
<tr>
<td class="sorter"></td>
<td>Row 1</td>
<td>Sample Content 1</td>
<td>Sample Content 1</td>
</tr>
<tr>
<td class="sorter"></td>
<td>Row 2</td>
<td>Sample Content 2</td>
<td>Sample Content 2</td>
</tr>
<tr class="nodrag">
<td class="sorter"></td>
<td>Row 3</td>
<td>Sample Content 3</td>
<td>Sample Content 3</td>
</tr>
<tr>
<td class="sorter"></td>
<td>Row 4</td>
<td>Sample Content 4</td>
<td>Sample Content 4</td>
</tr>
<tr>
<td class="sorter"></td>
<td>Row 5</td>
<td>Sample Content 5</td>
<td>Sample Content 5</td>
</tr>
</tbody>
</table>
<script type="text/javascript">
$("#table1").rowSorter({
handler: "td.sorter",
onDrop: function(tbody, row, new_index, old_index) {
$("#log").html(old_index + ". row moved to " + new_index);
}
});
</script>
</pre>
<script type="text/javascript" src="js/jquery1.91.min.js"></script>
<script type="text/javascript" src="js/asdui.js"></script>
<script type="text/javascript">
new ZUI.Rowsort('table1',{
handler: "td.sorter",
onDrop: function(tbody, row, new_index, old_index) {
$("#log").html(old_index + ". row moved to " + new_index);
}
});
</script>
</body>
</html>