1 |
torben |
2125 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
2 |
|
|
<html> |
3 |
|
|
<head> |
4 |
|
|
<meta http-equiv="content-type" content="text/html; charset=utf-8"> |
5 |
|
|
<link rel="shortcut icon" type="image/ico" href="http://www.sprymedia.co.uk/media/images/favicon.ico"> |
6 |
|
|
|
7 |
|
|
<title>ColReorder example</title> |
8 |
|
|
<style type="text/css" title="currentStyle"> |
9 |
|
|
@import "../../media/css/demo_page.css"; |
10 |
|
|
@import "../../media/css/demo_table.css"; |
11 |
|
|
thead input { width: 100% } |
12 |
|
|
input.search_init { color: #999 } |
13 |
|
|
</style> |
14 |
|
|
<script type="text/javascript" charset="utf-8" src="../../media/js/jquery.js"></script> |
15 |
|
|
<script type="text/javascript" charset="utf-8" src="../../media/js/jquery.dataTables.js"></script> |
16 |
|
|
<script type="text/javascript" charset="utf-8" src="media/js/FixedColumns.js"></script> |
17 |
|
|
<script type="text/javascript" charset="utf-8"> |
18 |
|
|
$(document).ready(function() { |
19 |
|
|
var oTable; |
20 |
|
|
|
21 |
|
|
/* Use the elements to store their own index */ |
22 |
|
|
$("thead input").each( function (i) { |
23 |
|
|
this.visibleIndex = i; |
24 |
|
|
} ); |
25 |
|
|
|
26 |
|
|
$("thead input").keyup( function () { |
27 |
|
|
/* If there is no visible index then we are in the cloned node */ |
28 |
|
|
var visIndex = typeof this.visibleIndex == 'undefined' ? 0 : this.visibleIndex; |
29 |
|
|
|
30 |
|
|
/* Filter on the column (the index) of this element */ |
31 |
|
|
oTable.fnFilter( this.value, visIndex ); |
32 |
|
|
} ); |
33 |
|
|
|
34 |
|
|
/* |
35 |
|
|
* Support functions to provide a little bit of 'user friendlyness' to the textboxes |
36 |
|
|
*/ |
37 |
|
|
$("thead input").each( function (i) { |
38 |
|
|
this.initVal = this.value; |
39 |
|
|
} ); |
40 |
|
|
|
41 |
|
|
$("thead input").focus( function () { |
42 |
|
|
if ( this.className == "search_init" ) |
43 |
|
|
{ |
44 |
|
|
this.className = ""; |
45 |
|
|
this.value = ""; |
46 |
|
|
} |
47 |
|
|
} ); |
48 |
|
|
|
49 |
|
|
$("thead input").blur( function (i) { |
50 |
|
|
if ( this.value == "" ) |
51 |
|
|
{ |
52 |
|
|
this.className = "search_init"; |
53 |
|
|
this.value = this.initVal; |
54 |
|
|
} |
55 |
|
|
} ); |
56 |
|
|
|
57 |
|
|
oTable = $('#example').dataTable( { |
58 |
|
|
"sScrollX": "100%", |
59 |
|
|
"sScrollXInner": "150%", |
60 |
|
|
"bScrollCollapse": true, |
61 |
|
|
"sDom": 'C<"clear">lfrtip', |
62 |
|
|
"aoColumnDefs": [ |
63 |
|
|
{ "bVisible": false, "aTargets": [ 2 ] } |
64 |
|
|
], |
65 |
|
|
"oLanguage": { |
66 |
|
|
"sSearch": "Search all columns:" |
67 |
|
|
} |
68 |
|
|
} ); |
69 |
|
|
new FixedColumns( oTable ); |
70 |
|
|
} ); |
71 |
|
|
</script> |
72 |
|
|
</head> |
73 |
|
|
<body id="dt_example"> |
74 |
|
|
<div id="container"> |
75 |
|
|
<div class="full_width big"> |
76 |
|
|
FixedColumns example - individual column filtering |
77 |
|
|
</div> |
78 |
|
|
|
79 |
|
|
<h1>Preamble</h1> |
80 |
|
|
<p>This example shows a fairly complex example of FixedColumns in action. Primarily it shows |
81 |
|
|
how multiple rows can be used in the THEAD or TFOOT element of the table such that you can |
82 |
|
|
provide extra information. In this case it shows how a column filter could be implemented.</p> |
83 |
|
|
|
84 |
|
|
<h1>Live example</h1> |
85 |
|
|
<form> |
86 |
|
|
<div id="demo"> |
87 |
|
|
<table cellpadding="0" cellspacing="0" border="0" class="display" id="example"> |
88 |
|
|
<thead> |
89 |
|
|
<tr> |
90 |
|
|
<th>Rendering engine</th> |
91 |
|
|
<th>Browser</th> |
92 |
|
|
<th>Platform(s)</th> |
93 |
|
|
<th>Engine version</th> |
94 |
|
|
<th>CSS grade</th> |
95 |
|
|
</tr> |
96 |
|
|
<tr> |
97 |
|
|
<td><input type="text" name="search_engine" value="Search engines" class="search_init" /></td> |
98 |
|
|
<td><input type="text" name="search_browser" value="Search browsers" class="search_init" /></td> |
99 |
|
|
<td><input type="text" name="search_platform" value="Search platforms" class="search_init" /></td> |
100 |
|
|
<td><input type="text" name="search_version" value="Search versions" class="search_init" /></td> |
101 |
|
|
<td><input type="text" name="search_grade" value="Search grades" class="search_init" /></td> |
102 |
|
|
</tr> |
103 |
|
|
</thead> |
104 |
|
|
<tfoot> |
105 |
|
|
<tr> |
106 |
|
|
<th>Rendering engine</th> |
107 |
|
|
<th>Browser</th> |
108 |
|
|
<th>Platform(s)</th> |
109 |
|
|
<th>Engine version</th> |
110 |
|
|
<th>CSS grade</th> |
111 |
|
|
</tr> |
112 |
|
|
</tfoot> |
113 |
|
|
<tbody> |
114 |
|
|
<tr class="odd_gradeX"> |
115 |
|
|
<td>Trident</td> |
116 |
|
|
<td>Internet Explorer 4.0</td> |
117 |
|
|
<td>Win 95+ (Entity: &)</td> |
118 |
|
|
<td class="center">4</td> |
119 |
|
|
<td class="center">X</td> |
120 |
|
|
</tr> |
121 |
|
|
<tr class="even_gradeC"> |
122 |
|
|
<td>Trident</td> |
123 |
|
|
<td>Internet Explorer 5.0</td> |
124 |
|
|
<td>Win 95+</td> |
125 |
|
|
<td class="center">5</td> |
126 |
|
|
<td class="center">C</td> |
127 |
|
|
</tr> |
128 |
|
|
<tr class="odd_gradeA"> |
129 |
|
|
<td>Trident</td> |
130 |
|
|
<td>Internet Explorer 5.5</td> |
131 |
|
|
<td>Win 95+</td> |
132 |
|
|
<td class="center">5.5</td> |
133 |
|
|
<td class="center">A</td> |
134 |
|
|
</tr> |
135 |
|
|
<tr class="even_gradeA"> |
136 |
|
|
<td>Trident</td> |
137 |
|
|
<td>Internet Explorer 6</td> |
138 |
|
|
<td>Win 98+</td> |
139 |
|
|
<td class="center">6</td> |
140 |
|
|
<td class="center">A</td> |
141 |
|
|
</tr> |
142 |
|
|
<tr class="odd_gradeA"> |
143 |
|
|
<td>Trident</td> |
144 |
|
|
<td>Internet Explorer 7</td> |
145 |
|
|
<td>Win XP SP2+</td> |
146 |
|
|
<td class="center">7</td> |
147 |
|
|
<td class="center">A</td> |
148 |
|
|
</tr> |
149 |
|
|
<tr class="even_gradeA"> |
150 |
|
|
<td>Trident</td> |
151 |
|
|
<td>AOL browser (AOL desktop)</td> |
152 |
|
|
<td>Win XP</td> |
153 |
|
|
<td class="center">6</td> |
154 |
|
|
<td class="center">A</td> |
155 |
|
|
</tr> |
156 |
|
|
<tr class="odd_gradeA"> |
157 |
|
|
<td>Gecko (UTF-8: $¢€)</td> |
158 |
|
|
<td>Firefox 1.0</td> |
159 |
|
|
<td>Win 98+ / OSX.2+</td> |
160 |
|
|
<td class="center">1.7</td> |
161 |
|
|
<td class="center">A</td> |
162 |
|
|
</tr> |
163 |
|
|
<tr class="even_gradeA"> |
164 |
|
|
<td>Gecko</td> |
165 |
|
|
<td>Firefox 1.5</td> |
166 |
|
|
<td>Win 98+ / OSX.2+</td> |
167 |
|
|
<td class="center">1.8</td> |
168 |
|
|
<td class="center">A</td> |
169 |
|
|
</tr> |
170 |
|
|
<tr class="odd_gradeA"> |
171 |
|
|
<td>Gecko</td> |
172 |
|
|
<td>Firefox 2.0</td> |
173 |
|
|
<td>Win 98+ / OSX.2+</td> |
174 |
|
|
<td class="center">1.8</td> |
175 |
|
|
<td class="center">A</td> |
176 |
|
|
</tr> |
177 |
|
|
<tr class="even_gradeA"> |
178 |
|
|
<td>Gecko</td> |
179 |
|
|
<td>Firefox 3.0</td> |
180 |
|
|
<td>Win 2k+ / OSX.3+</td> |
181 |
|
|
<td class="center">1.9</td> |
182 |
|
|
<td class="center">A</td> |
183 |
|
|
</tr> |
184 |
|
|
<tr class="odd_gradeA"> |
185 |
|
|
<td>Gecko</td> |
186 |
|
|
<td>Camino 1.0</td> |
187 |
|
|
<td>OSX.2+</td> |
188 |
|
|
<td class="center">1.8</td> |
189 |
|
|
<td class="center">A</td> |
190 |
|
|
</tr> |
191 |
|
|
<tr class="even_gradeA"> |
192 |
|
|
<td>Gecko</td> |
193 |
|
|
<td>Camino 1.5</td> |
194 |
|
|
<td>OSX.3+</td> |
195 |
|
|
<td class="center">1.8</td> |
196 |
|
|
<td class="center">A</td> |
197 |
|
|
</tr> |
198 |
|
|
<tr class="odd_gradeA"> |
199 |
|
|
<td>Gecko</td> |
200 |
|
|
<td>Netscape 7.2</td> |
201 |
|
|
<td>Win 95+ / Mac OS 8.6-9.2</td> |
202 |
|
|
<td class="center">1.7</td> |
203 |
|
|
<td class="center">A</td> |
204 |
|
|
</tr> |
205 |
|
|
<tr class="even_gradeA"> |
206 |
|
|
<td>Gecko</td> |
207 |
|
|
<td>Netscape Browser 8</td> |
208 |
|
|
<td>Win 98SE+</td> |
209 |
|
|
<td class="center">1.7</td> |
210 |
|
|
<td class="center">A</td> |
211 |
|
|
</tr> |
212 |
|
|
<tr class="odd_gradeA"> |
213 |
|
|
<td>Gecko</td> |
214 |
|
|
<td>Netscape Navigator 9</td> |
215 |
|
|
<td>Win 98+ / OSX.2+</td> |
216 |
|
|
<td class="center">1.8</td> |
217 |
|
|
<td class="center">A</td> |
218 |
|
|
</tr> |
219 |
|
|
<tr class="even_gradeA"> |
220 |
|
|
<td>Gecko</td> |
221 |
|
|
<td>Mozilla 1.0</td> |
222 |
|
|
<td>Win 95+ / OSX.1+</td> |
223 |
|
|
<td class="center">1</td> |
224 |
|
|
<td class="center">A</td> |
225 |
|
|
</tr> |
226 |
|
|
<tr class="odd_gradeA"> |
227 |
|
|
<td>Gecko</td> |
228 |
|
|
<td>Mozilla 1.1</td> |
229 |
|
|
<td>Win 95+ / OSX.1+</td> |
230 |
|
|
<td class="center">1.1</td> |
231 |
|
|
<td class="center">A</td> |
232 |
|
|
</tr> |
233 |
|
|
<tr class="even_gradeA"> |
234 |
|
|
<td>Gecko</td> |
235 |
|
|
<td>Mozilla 1.2</td> |
236 |
|
|
<td>Win 95+ / OSX.1+</td> |
237 |
|
|
<td class="center">1.2</td> |
238 |
|
|
<td class="center">A</td> |
239 |
|
|
</tr> |
240 |
|
|
<tr class="odd_gradeA"> |
241 |
|
|
<td>Gecko</td> |
242 |
|
|
<td>Mozilla 1.3</td> |
243 |
|
|
<td>Win 95+ / OSX.1+</td> |
244 |
|
|
<td class="center">1.3</td> |
245 |
|
|
<td class="center">A</td> |
246 |
|
|
</tr> |
247 |
|
|
<tr class="even_gradeA"> |
248 |
|
|
<td>Gecko</td> |
249 |
|
|
<td>Mozilla 1.4</td> |
250 |
|
|
<td>Win 95+ / OSX.1+</td> |
251 |
|
|
<td class="center">1.4</td> |
252 |
|
|
<td class="center">A</td> |
253 |
|
|
</tr> |
254 |
|
|
<tr class="odd_gradeA"> |
255 |
|
|
<td>Gecko</td> |
256 |
|
|
<td>Mozilla 1.5</td> |
257 |
|
|
<td>Win 95+ / OSX.1+</td> |
258 |
|
|
<td class="center">1.5</td> |
259 |
|
|
<td class="center">A</td> |
260 |
|
|
</tr> |
261 |
|
|
<tr class="even_gradeA"> |
262 |
|
|
<td>Gecko</td> |
263 |
|
|
<td>Mozilla 1.6</td> |
264 |
|
|
<td>Win 95+ / OSX.1+</td> |
265 |
|
|
<td class="center">1.6</td> |
266 |
|
|
<td class="center">A</td> |
267 |
|
|
</tr> |
268 |
|
|
<tr class="odd_gradeA"> |
269 |
|
|
<td>Gecko</td> |
270 |
|
|
<td>Mozilla 1.7</td> |
271 |
|
|
<td>Win 98+ / OSX.1+</td> |
272 |
|
|
<td class="center">1.7</td> |
273 |
|
|
<td class="center">A</td> |
274 |
|
|
</tr> |
275 |
|
|
<tr class="even_gradeA"> |
276 |
|
|
<td>Gecko</td> |
277 |
|
|
<td>Mozilla 1.8</td> |
278 |
|
|
<td>Win 98+ / OSX.1+</td> |
279 |
|
|
<td class="center">1.8</td> |
280 |
|
|
<td class="center">A</td> |
281 |
|
|
</tr> |
282 |
|
|
<tr class="odd_gradeA"> |
283 |
|
|
<td>Gecko</td> |
284 |
|
|
<td>Seamonkey 1.1</td> |
285 |
|
|
<td>Win 98+ / OSX.2+</td> |
286 |
|
|
<td class="center">1.8</td> |
287 |
|
|
<td class="center">A</td> |
288 |
|
|
</tr> |
289 |
|
|
<tr class="even_gradeA"> |
290 |
|
|
<td>Gecko</td> |
291 |
|
|
<td>Epiphany 2.20</td> |
292 |
|
|
<td>Gnome</td> |
293 |
|
|
<td class="center">1.8</td> |
294 |
|
|
<td class="center">A</td> |
295 |
|
|
</tr> |
296 |
|
|
<tr class="odd_gradeA"> |
297 |
|
|
<td>Webkit</td> |
298 |
|
|
<td>Safari 1.2</td> |
299 |
|
|
<td>OSX.3</td> |
300 |
|
|
<td class="center">125.5</td> |
301 |
|
|
<td class="center">A</td> |
302 |
|
|
</tr> |
303 |
|
|
<tr class="even_gradeA"> |
304 |
|
|
<td>Webkit</td> |
305 |
|
|
<td>Safari 1.3</td> |
306 |
|
|
<td>OSX.3</td> |
307 |
|
|
<td class="center">312.8</td> |
308 |
|
|
<td class="center">A</td> |
309 |
|
|
</tr> |
310 |
|
|
<tr class="odd_gradeA"> |
311 |
|
|
<td>Webkit</td> |
312 |
|
|
<td>Safari 2.0</td> |
313 |
|
|
<td>OSX.4+</td> |
314 |
|
|
<td class="center">419.3</td> |
315 |
|
|
<td class="center">A</td> |
316 |
|
|
</tr> |
317 |
|
|
<tr class="even_gradeA"> |
318 |
|
|
<td>Webkit</td> |
319 |
|
|
<td>Safari 3.0</td> |
320 |
|
|
<td>OSX.4+</td> |
321 |
|
|
<td class="center">522.1</td> |
322 |
|
|
<td class="center">A</td> |
323 |
|
|
</tr> |
324 |
|
|
<tr class="odd_gradeA"> |
325 |
|
|
<td>Webkit</td> |
326 |
|
|
<td>OmniWeb 5.5</td> |
327 |
|
|
<td>OSX.4+</td> |
328 |
|
|
<td class="center">420</td> |
329 |
|
|
<td class="center">A</td> |
330 |
|
|
</tr> |
331 |
|
|
<tr class="even_gradeA"> |
332 |
|
|
<td>Webkit</td> |
333 |
|
|
<td>iPod Touch / iPhone</td> |
334 |
|
|
<td>iPod</td> |
335 |
|
|
<td class="center">420.1</td> |
336 |
|
|
<td class="center">A</td> |
337 |
|
|
</tr> |
338 |
|
|
<tr class="odd_gradeA"> |
339 |
|
|
<td>Webkit</td> |
340 |
|
|
<td>S60</td> |
341 |
|
|
<td>S60</td> |
342 |
|
|
<td class="center">413</td> |
343 |
|
|
<td class="center">A</td> |
344 |
|
|
</tr> |
345 |
|
|
<tr class="even_gradeA"> |
346 |
|
|
<td>Presto</td> |
347 |
|
|
<td>Opera 7.0</td> |
348 |
|
|
<td>Win 95+ / OSX.1+</td> |
349 |
|
|
<td class="center">-</td> |
350 |
|
|
<td class="center">A</td> |
351 |
|
|
</tr> |
352 |
|
|
<tr class="odd_gradeA"> |
353 |
|
|
<td>Presto</td> |
354 |
|
|
<td>Opera 7.5</td> |
355 |
|
|
<td>Win 95+ / OSX.2+</td> |
356 |
|
|
<td class="center">-</td> |
357 |
|
|
<td class="center">A</td> |
358 |
|
|
</tr> |
359 |
|
|
<tr class="even_gradeA"> |
360 |
|
|
<td>Presto</td> |
361 |
|
|
<td>Opera 8.0</td> |
362 |
|
|
<td>Win 95+ / OSX.2+</td> |
363 |
|
|
<td class="center">-</td> |
364 |
|
|
<td class="center">A</td> |
365 |
|
|
</tr> |
366 |
|
|
<tr class="odd_gradeA"> |
367 |
|
|
<td>Presto</td> |
368 |
|
|
<td>Opera 8.5</td> |
369 |
|
|
<td>Win 95+ / OSX.2+</td> |
370 |
|
|
<td class="center">-</td> |
371 |
|
|
<td class="center">A</td> |
372 |
|
|
</tr> |
373 |
|
|
<tr class="even_gradeA"> |
374 |
|
|
<td>Presto</td> |
375 |
|
|
<td>Opera 9.0</td> |
376 |
|
|
<td>Win 95+ / OSX.3+</td> |
377 |
|
|
<td class="center">-</td> |
378 |
|
|
<td class="center">A</td> |
379 |
|
|
</tr> |
380 |
|
|
<tr class="odd_gradeA"> |
381 |
|
|
<td>Presto</td> |
382 |
|
|
<td>Opera 9.2</td> |
383 |
|
|
<td>Win 88+ / OSX.3+</td> |
384 |
|
|
<td class="center">-</td> |
385 |
|
|
<td class="center">A</td> |
386 |
|
|
</tr> |
387 |
|
|
<tr class="even_gradeA"> |
388 |
|
|
<td>Presto</td> |
389 |
|
|
<td>Opera 9.5</td> |
390 |
|
|
<td>Win 88+ / OSX.3+</td> |
391 |
|
|
<td class="center">-</td> |
392 |
|
|
<td class="center">A</td> |
393 |
|
|
</tr> |
394 |
|
|
<tr class="odd_gradeA"> |
395 |
|
|
<td>Presto</td> |
396 |
|
|
<td>Opera for Wii</td> |
397 |
|
|
<td>Wii</td> |
398 |
|
|
<td class="center">-</td> |
399 |
|
|
<td class="center">A</td> |
400 |
|
|
</tr> |
401 |
|
|
<tr class="even_gradeA"> |
402 |
|
|
<td>Presto</td> |
403 |
|
|
<td>Nokia N800</td> |
404 |
|
|
<td>N800</td> |
405 |
|
|
<td class="center">-</td> |
406 |
|
|
<td class="center">A</td> |
407 |
|
|
</tr> |
408 |
|
|
<tr class="odd_gradeA"> |
409 |
|
|
<td>Presto</td> |
410 |
|
|
<td>Nintendo DS browser</td> |
411 |
|
|
<td>Nintendo DS</td> |
412 |
|
|
<td class="center">8.5</td> |
413 |
|
|
<td class="center">C/A</td> |
414 |
|
|
</tr> |
415 |
|
|
<tr class="even_gradeC"> |
416 |
|
|
<td>KHTML</td> |
417 |
|
|
<td>Konqureror 3.1</td> |
418 |
|
|
<td>KDE 3.1</td> |
419 |
|
|
<td class="center">3.1</td> |
420 |
|
|
<td class="center">C</td> |
421 |
|
|
</tr> |
422 |
|
|
<tr class="odd_gradeA"> |
423 |
|
|
<td>KHTML</td> |
424 |
|
|
<td>Konqureror 3.3</td> |
425 |
|
|
<td>KDE 3.3</td> |
426 |
|
|
<td class="center">3.3</td> |
427 |
|
|
<td class="center">A</td> |
428 |
|
|
</tr> |
429 |
|
|
<tr class="even_gradeA"> |
430 |
|
|
<td>KHTML</td> |
431 |
|
|
<td>Konqureror 3.5</td> |
432 |
|
|
<td>KDE 3.5</td> |
433 |
|
|
<td class="center">3.5</td> |
434 |
|
|
<td class="center">A</td> |
435 |
|
|
</tr> |
436 |
|
|
<tr class="odd_gradeX"> |
437 |
|
|
<td>Tasman</td> |
438 |
|
|
<td>Internet Explorer 4.5</td> |
439 |
|
|
<td>Mac OS 8-9</td> |
440 |
|
|
<td class="center">-</td> |
441 |
|
|
<td class="center">X</td> |
442 |
|
|
</tr> |
443 |
|
|
<tr class="even_gradeC"> |
444 |
|
|
<td>Tasman</td> |
445 |
|
|
<td>Internet Explorer 5.1</td> |
446 |
|
|
<td>Mac OS 7.6-9</td> |
447 |
|
|
<td class="center">1</td> |
448 |
|
|
<td class="center">C</td> |
449 |
|
|
</tr> |
450 |
|
|
<tr class="odd_gradeC"> |
451 |
|
|
<td>Tasman</td> |
452 |
|
|
<td>Internet Explorer 5.2</td> |
453 |
|
|
<td>Mac OS 8-X</td> |
454 |
|
|
<td class="center">1</td> |
455 |
|
|
<td class="center">C</td> |
456 |
|
|
</tr> |
457 |
|
|
<tr class="even_gradeA"> |
458 |
|
|
<td>Misc</td> |
459 |
|
|
<td>NetFront 3.1</td> |
460 |
|
|
<td>Embedded devices</td> |
461 |
|
|
<td class="center">-</td> |
462 |
|
|
<td class="center">C</td> |
463 |
|
|
</tr> |
464 |
|
|
<tr class="odd_gradeA"> |
465 |
|
|
<td>Misc</td> |
466 |
|
|
<td>NetFront 3.4</td> |
467 |
|
|
<td>Embedded devices</td> |
468 |
|
|
<td class="center">-</td> |
469 |
|
|
<td class="center">A</td> |
470 |
|
|
</tr> |
471 |
|
|
<tr class="even_gradeX"> |
472 |
|
|
<td>Misc</td> |
473 |
|
|
<td>Dillo 0.8</td> |
474 |
|
|
<td>Embedded devices</td> |
475 |
|
|
<td class="center">-</td> |
476 |
|
|
<td class="center">X</td> |
477 |
|
|
</tr> |
478 |
|
|
<tr class="odd_gradeX"> |
479 |
|
|
<td>Misc</td> |
480 |
|
|
<td>Links</td> |
481 |
|
|
<td>Text only</td> |
482 |
|
|
<td class="center">-</td> |
483 |
|
|
<td class="center">X</td> |
484 |
|
|
</tr> |
485 |
|
|
<tr class="even_gradeX"> |
486 |
|
|
<td>Misc</td> |
487 |
|
|
<td>Lynx</td> |
488 |
|
|
<td>Text only</td> |
489 |
|
|
<td class="center">-</td> |
490 |
|
|
<td class="center">X</td> |
491 |
|
|
</tr> |
492 |
|
|
<tr class="odd_gradeC"> |
493 |
|
|
<td>Misc</td> |
494 |
|
|
<td>IE Mobile</td> |
495 |
|
|
<td>Windows Mobile 6</td> |
496 |
|
|
<td class="center">-</td> |
497 |
|
|
<td class="center">C</td> |
498 |
|
|
</tr> |
499 |
|
|
<tr class="even_gradeC"> |
500 |
|
|
<td>Misc</td> |
501 |
|
|
<td>PSP browser</td> |
502 |
|
|
<td>PSP</td> |
503 |
|
|
<td class="center">-</td> |
504 |
|
|
<td class="center">C</td> |
505 |
|
|
</tr> |
506 |
|
|
<tr class="odd_gradeU"> |
507 |
|
|
<td>Other browsers</td> |
508 |
|
|
<td>All others</td> |
509 |
|
|
<td>-</td> |
510 |
|
|
<td class="center">-</td> |
511 |
|
|
<td class="center">U</td> |
512 |
|
|
</tr> |
513 |
|
|
</tbody> |
514 |
|
|
</table> |
515 |
|
|
</div> |
516 |
|
|
</form> |
517 |
|
|
<div class="spacer"></div> |
518 |
|
|
|
519 |
|
|
|
520 |
|
|
<h1>Initialisation code</h1> |
521 |
|
|
<pre>$(document).ready(function() { |
522 |
|
|
var oTable; |
523 |
|
|
|
524 |
|
|
/* Use the elements to store their own index */ |
525 |
|
|
$("thead input").each( function (i) { |
526 |
|
|
this.visibleIndex = i; |
527 |
|
|
} ); |
528 |
|
|
|
529 |
|
|
$("thead input").keyup( function () { |
530 |
|
|
/* If there is no visible index then we are in the cloned node */ |
531 |
|
|
var visIndex = typeof this.visibleIndex == 'undefined' ? 0 : this.visibleIndex; |
532 |
|
|
|
533 |
|
|
/* Filter on the column (the index) of this element */ |
534 |
|
|
oTable.fnFilter( this.value, visIndex ); |
535 |
|
|
} ); |
536 |
|
|
|
537 |
|
|
/* |
538 |
|
|
* Support functions to provide a little bit of 'user friendlyness' to the textboxes |
539 |
|
|
*/ |
540 |
|
|
$("thead input").each( function (i) { |
541 |
|
|
this.initVal = this.value; |
542 |
|
|
} ); |
543 |
|
|
|
544 |
|
|
$("thead input").focus( function () { |
545 |
|
|
if ( this.className == "search_init" ) |
546 |
|
|
{ |
547 |
|
|
this.className = ""; |
548 |
|
|
this.value = ""; |
549 |
|
|
} |
550 |
|
|
} ); |
551 |
|
|
|
552 |
|
|
$("thead input").blur( function (i) { |
553 |
|
|
if ( this.value == "" ) |
554 |
|
|
{ |
555 |
|
|
this.className = "search_init"; |
556 |
|
|
this.value = this.initVal; |
557 |
|
|
} |
558 |
|
|
} ); |
559 |
|
|
|
560 |
|
|
oTable = $('#example').dataTable( { |
561 |
|
|
"sScrollX": "100%", |
562 |
|
|
"sScrollXInner": "150%", |
563 |
|
|
"bScrollCollapse": true, |
564 |
|
|
"sDom": 'C<"clear">lfrtip', |
565 |
|
|
"aoColumnDefs": [ |
566 |
|
|
{ "bVisible": false, "aTargets": [ 2 ] } |
567 |
|
|
], |
568 |
|
|
"oLanguage": { |
569 |
|
|
"sSearch": "Search all columns:" |
570 |
|
|
} |
571 |
|
|
} ); |
572 |
|
|
new FixedColumns( oTable ); |
573 |
|
|
} );</pre> |
574 |
|
|
|
575 |
|
|
|
576 |
|
|
<h1>Documentation</h1> |
577 |
|
|
<ul> |
578 |
|
|
<li><a href="http://datatables.net/extras/fixedcolumns">Usage</a></li> |
579 |
|
|
<li><a href="http://datatables.net/docs/FixedColumns">API / parameters</a></li> |
580 |
|
|
</ul> |
581 |
|
|
|
582 |
|
|
<h1>Basic examples</h1> |
583 |
|
|
<ul> |
584 |
|
|
<li><a href="index.html">Basic demo of FixedColumns with zero initialisation</a></li> |
585 |
|
|
<li><a href="left_right_columns.html">Fix the left and right columns in place</a></li> |
586 |
|
|
<li><a href="index_column.html">Index column attached to side of the table</a></li> |
587 |
|
|
<li><a href="x_y_scrolling.html">Index column, but with Y scrolling and no pagination</a></li> |
588 |
|
|
<li><a href="two_columns.html">Two columns fixed in place</a></li> |
589 |
|
|
<li><a href="right_column.html">Fix the right column in place</a></li> |
590 |
|
|
<li><a href="css_size.html">Speeding up row height matching with CSS</a></li> |
591 |
|
|
<li><a href="themed.html">jQuery UI themed table with FixedColumns</a></li> |
592 |
|
|
</ul> |
593 |
|
|
|
594 |
|
|
<h1>Advanced examples</h1> |
595 |
|
|
<ul> |
596 |
|
|
<li><a href="rowspan.html">Using ROWSPAN with FixedColumns</a></li> |
597 |
|
|
<li><a href="server-side-processing.html">Server-side processing with FixedColumns</a></li> |
598 |
|
|
<li><a href="col_filter.html">Individual column filtering</a></li> |
599 |
|
|
<li><a href="scale_fixed.html">Setting the fixed column width and resizing the table</a></li> |
600 |
|
|
<li><a href="scale_relative.html">Setting the fixed column width with relative sizing</a></li> |
601 |
|
|
<li><a href="row_grouping_height.html">Row grouping by grouping like rows in the fixed column</a></li> |
602 |
|
|
<li><a href="row_grouping.html">Row grouping by inserting a grouping row</a></li> |
603 |
|
|
<ul> |
604 |
|
|
|
605 |
|
|
|
606 |
|
|
<div id="footer" style="text-align:center;"> |
607 |
|
|
<span style="font-size:10px;"> |
608 |
|
|
FixedColumns and DataTables © Allan Jardine 2011.<br> |
609 |
|
|
</span> |
610 |
|
|
</div> |
611 |
|
|
</div> |
612 |
|
|
</body> |
613 |
|
|
</html> |