0
|
1 <!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 @import "media/css/ColReorder.css";
|
|
12 @import "../ColVis/media/css/ColVis.css";
|
|
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/ColReorder.js"></script>
|
|
17 <script type="text/javascript" charset="utf-8" src="../ColVis/media/js/ColVis.js"></script>
|
|
18 <script type="text/javascript" charset="utf-8">
|
|
19 $(document).ready( function () {
|
|
20 var oTable = $('#example').dataTable( {
|
|
21 "sDom": 'RC<"clear">lfrtip',
|
|
22 "aoColumnDefs": [
|
|
23 { "bVisible": false, "aTargets": [ 1 ] }
|
|
24 ]
|
|
25 } );
|
|
26 } );
|
|
27 </script>
|
|
28 </head>
|
|
29 <body id="dt_example">
|
|
30 <div id="container">
|
|
31 <div class="full_width big">
|
|
32 ColReorder example with ColVis
|
|
33 </div>
|
|
34
|
|
35 <h1>Preamble</h1>
|
|
36 <p>The ColReorder plug-in interacts with the ColVis plug-in for DataTables by updating the
|
|
37 order of the list of columns whenever a reorder is done. This is shown in the example
|
|
38 below, where one column has been hidden by default to add extra emphasis to ColVis.</p>
|
|
39
|
|
40 <h1>Live example</h1>
|
|
41 <form>
|
|
42 <div id="demo">
|
|
43 <table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
|
|
44 <thead>
|
|
45 <tr>
|
|
46 <th>Rendering engine</th>
|
|
47 <th>Browser</th>
|
|
48 <th>Platform(s)</th>
|
|
49 <th>Engine version</th>
|
|
50 <th>CSS grade</th>
|
|
51 </tr>
|
|
52 </thead>
|
|
53 <tfoot>
|
|
54 <tr>
|
|
55 <th>Rendering engine</th>
|
|
56 <th>Browser</th>
|
|
57 <th>Platform(s)</th>
|
|
58 <th>Engine version</th>
|
|
59 <th>CSS grade</th>
|
|
60 </tr>
|
|
61 </tfoot>
|
|
62 <tbody>
|
|
63 <tr class="odd_gradeX">
|
|
64 <td>Trident</td>
|
|
65 <td>Internet Explorer 4.0</td>
|
|
66 <td>Win 95+ (Entity: &)</td>
|
|
67 <td class="center">4</td>
|
|
68 <td class="center">X</td>
|
|
69 </tr>
|
|
70 <tr class="even_gradeC">
|
|
71 <td>Trident</td>
|
|
72 <td>Internet Explorer 5.0</td>
|
|
73 <td>Win 95+</td>
|
|
74 <td class="center">5</td>
|
|
75 <td class="center">C</td>
|
|
76 </tr>
|
|
77 <tr class="odd_gradeA">
|
|
78 <td>Trident</td>
|
|
79 <td>Internet Explorer 5.5</td>
|
|
80 <td>Win 95+</td>
|
|
81 <td class="center">5.5</td>
|
|
82 <td class="center">A</td>
|
|
83 </tr>
|
|
84 <tr class="even_gradeA">
|
|
85 <td>Trident</td>
|
|
86 <td>Internet Explorer 6</td>
|
|
87 <td>Win 98+</td>
|
|
88 <td class="center">6</td>
|
|
89 <td class="center">A</td>
|
|
90 </tr>
|
|
91 <tr class="odd_gradeA">
|
|
92 <td>Trident</td>
|
|
93 <td>Internet Explorer 7</td>
|
|
94 <td>Win XP SP2+</td>
|
|
95 <td class="center">7</td>
|
|
96 <td class="center">A</td>
|
|
97 </tr>
|
|
98 <tr class="even_gradeA">
|
|
99 <td>Trident</td>
|
|
100 <td>AOL browser (AOL desktop)</td>
|
|
101 <td>Win XP</td>
|
|
102 <td class="center">6</td>
|
|
103 <td class="center">A</td>
|
|
104 </tr>
|
|
105 <tr class="odd_gradeA">
|
|
106 <td>Gecko (UTF-8: $¢€)</td>
|
|
107 <td>Firefox 1.0</td>
|
|
108 <td>Win 98+ / OSX.2+</td>
|
|
109 <td class="center">1.7</td>
|
|
110 <td class="center">A</td>
|
|
111 </tr>
|
|
112 <tr class="even_gradeA">
|
|
113 <td>Gecko</td>
|
|
114 <td>Firefox 1.5</td>
|
|
115 <td>Win 98+ / OSX.2+</td>
|
|
116 <td class="center">1.8</td>
|
|
117 <td class="center">A</td>
|
|
118 </tr>
|
|
119 <tr class="odd_gradeA">
|
|
120 <td>Gecko</td>
|
|
121 <td>Firefox 2.0</td>
|
|
122 <td>Win 98+ / OSX.2+</td>
|
|
123 <td class="center">1.8</td>
|
|
124 <td class="center">A</td>
|
|
125 </tr>
|
|
126 <tr class="even_gradeA">
|
|
127 <td>Gecko</td>
|
|
128 <td>Firefox 3.0</td>
|
|
129 <td>Win 2k+ / OSX.3+</td>
|
|
130 <td class="center">1.9</td>
|
|
131 <td class="center">A</td>
|
|
132 </tr>
|
|
133 <tr class="odd_gradeA">
|
|
134 <td>Gecko</td>
|
|
135 <td>Camino 1.0</td>
|
|
136 <td>OSX.2+</td>
|
|
137 <td class="center">1.8</td>
|
|
138 <td class="center">A</td>
|
|
139 </tr>
|
|
140 <tr class="even_gradeA">
|
|
141 <td>Gecko</td>
|
|
142 <td>Camino 1.5</td>
|
|
143 <td>OSX.3+</td>
|
|
144 <td class="center">1.8</td>
|
|
145 <td class="center">A</td>
|
|
146 </tr>
|
|
147 <tr class="odd_gradeA">
|
|
148 <td>Gecko</td>
|
|
149 <td>Netscape 7.2</td>
|
|
150 <td>Win 95+ / Mac OS 8.6-9.2</td>
|
|
151 <td class="center">1.7</td>
|
|
152 <td class="center">A</td>
|
|
153 </tr>
|
|
154 <tr class="even_gradeA">
|
|
155 <td>Gecko</td>
|
|
156 <td>Netscape Browser 8</td>
|
|
157 <td>Win 98SE+</td>
|
|
158 <td class="center">1.7</td>
|
|
159 <td class="center">A</td>
|
|
160 </tr>
|
|
161 <tr class="odd_gradeA">
|
|
162 <td>Gecko</td>
|
|
163 <td>Netscape Navigator 9</td>
|
|
164 <td>Win 98+ / OSX.2+</td>
|
|
165 <td class="center">1.8</td>
|
|
166 <td class="center">A</td>
|
|
167 </tr>
|
|
168 <tr class="even_gradeA">
|
|
169 <td>Gecko</td>
|
|
170 <td>Mozilla 1.0</td>
|
|
171 <td>Win 95+ / OSX.1+</td>
|
|
172 <td class="center">1</td>
|
|
173 <td class="center">A</td>
|
|
174 </tr>
|
|
175 <tr class="odd_gradeA">
|
|
176 <td>Gecko</td>
|
|
177 <td>Mozilla 1.1</td>
|
|
178 <td>Win 95+ / OSX.1+</td>
|
|
179 <td class="center">1.1</td>
|
|
180 <td class="center">A</td>
|
|
181 </tr>
|
|
182 <tr class="even_gradeA">
|
|
183 <td>Gecko</td>
|
|
184 <td>Mozilla 1.2</td>
|
|
185 <td>Win 95+ / OSX.1+</td>
|
|
186 <td class="center">1.2</td>
|
|
187 <td class="center">A</td>
|
|
188 </tr>
|
|
189 <tr class="odd_gradeA">
|
|
190 <td>Gecko</td>
|
|
191 <td>Mozilla 1.3</td>
|
|
192 <td>Win 95+ / OSX.1+</td>
|
|
193 <td class="center">1.3</td>
|
|
194 <td class="center">A</td>
|
|
195 </tr>
|
|
196 <tr class="even_gradeA">
|
|
197 <td>Gecko</td>
|
|
198 <td>Mozilla 1.4</td>
|
|
199 <td>Win 95+ / OSX.1+</td>
|
|
200 <td class="center">1.4</td>
|
|
201 <td class="center">A</td>
|
|
202 </tr>
|
|
203 <tr class="odd_gradeA">
|
|
204 <td>Gecko</td>
|
|
205 <td>Mozilla 1.5</td>
|
|
206 <td>Win 95+ / OSX.1+</td>
|
|
207 <td class="center">1.5</td>
|
|
208 <td class="center">A</td>
|
|
209 </tr>
|
|
210 <tr class="even_gradeA">
|
|
211 <td>Gecko</td>
|
|
212 <td>Mozilla 1.6</td>
|
|
213 <td>Win 95+ / OSX.1+</td>
|
|
214 <td class="center">1.6</td>
|
|
215 <td class="center">A</td>
|
|
216 </tr>
|
|
217 <tr class="odd_gradeA">
|
|
218 <td>Gecko</td>
|
|
219 <td>Mozilla 1.7</td>
|
|
220 <td>Win 98+ / OSX.1+</td>
|
|
221 <td class="center">1.7</td>
|
|
222 <td class="center">A</td>
|
|
223 </tr>
|
|
224 <tr class="even_gradeA">
|
|
225 <td>Gecko</td>
|
|
226 <td>Mozilla 1.8</td>
|
|
227 <td>Win 98+ / OSX.1+</td>
|
|
228 <td class="center">1.8</td>
|
|
229 <td class="center">A</td>
|
|
230 </tr>
|
|
231 <tr class="odd_gradeA">
|
|
232 <td>Gecko</td>
|
|
233 <td>Seamonkey 1.1</td>
|
|
234 <td>Win 98+ / OSX.2+</td>
|
|
235 <td class="center">1.8</td>
|
|
236 <td class="center">A</td>
|
|
237 </tr>
|
|
238 <tr class="even_gradeA">
|
|
239 <td>Gecko</td>
|
|
240 <td>Epiphany 2.20</td>
|
|
241 <td>Gnome</td>
|
|
242 <td class="center">1.8</td>
|
|
243 <td class="center">A</td>
|
|
244 </tr>
|
|
245 <tr class="odd_gradeA">
|
|
246 <td>Webkit</td>
|
|
247 <td>Safari 1.2</td>
|
|
248 <td>OSX.3</td>
|
|
249 <td class="center">125.5</td>
|
|
250 <td class="center">A</td>
|
|
251 </tr>
|
|
252 <tr class="even_gradeA">
|
|
253 <td>Webkit</td>
|
|
254 <td>Safari 1.3</td>
|
|
255 <td>OSX.3</td>
|
|
256 <td class="center">312.8</td>
|
|
257 <td class="center">A</td>
|
|
258 </tr>
|
|
259 <tr class="odd_gradeA">
|
|
260 <td>Webkit</td>
|
|
261 <td>Safari 2.0</td>
|
|
262 <td>OSX.4+</td>
|
|
263 <td class="center">419.3</td>
|
|
264 <td class="center">A</td>
|
|
265 </tr>
|
|
266 <tr class="even_gradeA">
|
|
267 <td>Webkit</td>
|
|
268 <td>Safari 3.0</td>
|
|
269 <td>OSX.4+</td>
|
|
270 <td class="center">522.1</td>
|
|
271 <td class="center">A</td>
|
|
272 </tr>
|
|
273 <tr class="odd_gradeA">
|
|
274 <td>Webkit</td>
|
|
275 <td>OmniWeb 5.5</td>
|
|
276 <td>OSX.4+</td>
|
|
277 <td class="center">420</td>
|
|
278 <td class="center">A</td>
|
|
279 </tr>
|
|
280 <tr class="even_gradeA">
|
|
281 <td>Webkit</td>
|
|
282 <td>iPod Touch / iPhone</td>
|
|
283 <td>iPod</td>
|
|
284 <td class="center">420.1</td>
|
|
285 <td class="center">A</td>
|
|
286 </tr>
|
|
287 <tr class="odd_gradeA">
|
|
288 <td>Webkit</td>
|
|
289 <td>S60</td>
|
|
290 <td>S60</td>
|
|
291 <td class="center">413</td>
|
|
292 <td class="center">A</td>
|
|
293 </tr>
|
|
294 <tr class="even_gradeA">
|
|
295 <td>Presto</td>
|
|
296 <td>Opera 7.0</td>
|
|
297 <td>Win 95+ / OSX.1+</td>
|
|
298 <td class="center">-</td>
|
|
299 <td class="center">A</td>
|
|
300 </tr>
|
|
301 <tr class="odd_gradeA">
|
|
302 <td>Presto</td>
|
|
303 <td>Opera 7.5</td>
|
|
304 <td>Win 95+ / OSX.2+</td>
|
|
305 <td class="center">-</td>
|
|
306 <td class="center">A</td>
|
|
307 </tr>
|
|
308 <tr class="even_gradeA">
|
|
309 <td>Presto</td>
|
|
310 <td>Opera 8.0</td>
|
|
311 <td>Win 95+ / OSX.2+</td>
|
|
312 <td class="center">-</td>
|
|
313 <td class="center">A</td>
|
|
314 </tr>
|
|
315 <tr class="odd_gradeA">
|
|
316 <td>Presto</td>
|
|
317 <td>Opera 8.5</td>
|
|
318 <td>Win 95+ / OSX.2+</td>
|
|
319 <td class="center">-</td>
|
|
320 <td class="center">A</td>
|
|
321 </tr>
|
|
322 <tr class="even_gradeA">
|
|
323 <td>Presto</td>
|
|
324 <td>Opera 9.0</td>
|
|
325 <td>Win 95+ / OSX.3+</td>
|
|
326 <td class="center">-</td>
|
|
327 <td class="center">A</td>
|
|
328 </tr>
|
|
329 <tr class="odd_gradeA">
|
|
330 <td>Presto</td>
|
|
331 <td>Opera 9.2</td>
|
|
332 <td>Win 88+ / OSX.3+</td>
|
|
333 <td class="center">-</td>
|
|
334 <td class="center">A</td>
|
|
335 </tr>
|
|
336 <tr class="even_gradeA">
|
|
337 <td>Presto</td>
|
|
338 <td>Opera 9.5</td>
|
|
339 <td>Win 88+ / OSX.3+</td>
|
|
340 <td class="center">-</td>
|
|
341 <td class="center">A</td>
|
|
342 </tr>
|
|
343 <tr class="odd_gradeA">
|
|
344 <td>Presto</td>
|
|
345 <td>Opera for Wii</td>
|
|
346 <td>Wii</td>
|
|
347 <td class="center">-</td>
|
|
348 <td class="center">A</td>
|
|
349 </tr>
|
|
350 <tr class="even_gradeA">
|
|
351 <td>Presto</td>
|
|
352 <td>Nokia N800</td>
|
|
353 <td>N800</td>
|
|
354 <td class="center">-</td>
|
|
355 <td class="center">A</td>
|
|
356 </tr>
|
|
357 <tr class="odd_gradeA">
|
|
358 <td>Presto</td>
|
|
359 <td>Nintendo DS browser</td>
|
|
360 <td>Nintendo DS</td>
|
|
361 <td class="center">8.5</td>
|
|
362 <td class="center">C/A<sup>1</sup></td>
|
|
363 </tr>
|
|
364 <tr class="even_gradeC">
|
|
365 <td>KHTML</td>
|
|
366 <td>Konqureror 3.1</td>
|
|
367 <td>KDE 3.1</td>
|
|
368 <td class="center">3.1</td>
|
|
369 <td class="center">C</td>
|
|
370 </tr>
|
|
371 <tr class="odd_gradeA">
|
|
372 <td>KHTML</td>
|
|
373 <td>Konqureror 3.3</td>
|
|
374 <td>KDE 3.3</td>
|
|
375 <td class="center">3.3</td>
|
|
376 <td class="center">A</td>
|
|
377 </tr>
|
|
378 <tr class="even_gradeA">
|
|
379 <td>KHTML</td>
|
|
380 <td>Konqureror 3.5</td>
|
|
381 <td>KDE 3.5</td>
|
|
382 <td class="center">3.5</td>
|
|
383 <td class="center">A</td>
|
|
384 </tr>
|
|
385 <tr class="odd_gradeX">
|
|
386 <td>Tasman</td>
|
|
387 <td>Internet Explorer 4.5</td>
|
|
388 <td>Mac OS 8-9</td>
|
|
389 <td class="center">-</td>
|
|
390 <td class="center">X</td>
|
|
391 </tr>
|
|
392 <tr class="even_gradeC">
|
|
393 <td>Tasman</td>
|
|
394 <td>Internet Explorer 5.1</td>
|
|
395 <td>Mac OS 7.6-9</td>
|
|
396 <td class="center">1</td>
|
|
397 <td class="center">C</td>
|
|
398 </tr>
|
|
399 <tr class="odd_gradeC">
|
|
400 <td>Tasman</td>
|
|
401 <td>Internet Explorer 5.2</td>
|
|
402 <td>Mac OS 8-X</td>
|
|
403 <td class="center">1</td>
|
|
404 <td class="center">C</td>
|
|
405 </tr>
|
|
406 <tr class="even_gradeA">
|
|
407 <td>Misc</td>
|
|
408 <td>NetFront 3.1</td>
|
|
409 <td>Embedded devices</td>
|
|
410 <td class="center">-</td>
|
|
411 <td class="center">C</td>
|
|
412 </tr>
|
|
413 <tr class="odd_gradeA">
|
|
414 <td>Misc</td>
|
|
415 <td>NetFront 3.4</td>
|
|
416 <td>Embedded devices</td>
|
|
417 <td class="center">-</td>
|
|
418 <td class="center">A</td>
|
|
419 </tr>
|
|
420 <tr class="even_gradeX">
|
|
421 <td>Misc</td>
|
|
422 <td>Dillo 0.8</td>
|
|
423 <td>Embedded devices</td>
|
|
424 <td class="center">-</td>
|
|
425 <td class="center">X</td>
|
|
426 </tr>
|
|
427 <tr class="odd_gradeX">
|
|
428 <td>Misc</td>
|
|
429 <td>Links</td>
|
|
430 <td>Text only</td>
|
|
431 <td class="center">-</td>
|
|
432 <td class="center">X</td>
|
|
433 </tr>
|
|
434 <tr class="even_gradeX">
|
|
435 <td>Misc</td>
|
|
436 <td>Lynx</td>
|
|
437 <td>Text only</td>
|
|
438 <td class="center">-</td>
|
|
439 <td class="center">X</td>
|
|
440 </tr>
|
|
441 <tr class="odd_gradeC">
|
|
442 <td>Misc</td>
|
|
443 <td>IE Mobile</td>
|
|
444 <td>Windows Mobile 6</td>
|
|
445 <td class="center">-</td>
|
|
446 <td class="center">C</td>
|
|
447 </tr>
|
|
448 <tr class="even_gradeC">
|
|
449 <td>Misc</td>
|
|
450 <td>PSP browser</td>
|
|
451 <td>PSP</td>
|
|
452 <td class="center">-</td>
|
|
453 <td class="center">C</td>
|
|
454 </tr>
|
|
455 <tr class="odd_gradeU">
|
|
456 <td>Other browsers</td>
|
|
457 <td>All others</td>
|
|
458 <td>-</td>
|
|
459 <td class="center">-</td>
|
|
460 <td class="center">U</td>
|
|
461 </tr>
|
|
462 </tbody>
|
|
463 </table>
|
|
464 </div>
|
|
465 </form>
|
|
466 <div class="spacer"></div>
|
|
467
|
|
468
|
|
469 <h1>Examples</h1>
|
|
470 <ul>
|
|
471 <li><a href="index.html">Basic initialisation</a></li>
|
|
472 <li><a href="alt_insert.html">Styling the insert cursor</a></li>
|
|
473 <li><a href="col_filter.html">Individual column filtering</a></li>
|
|
474 <li><a href="colvis.html">Integration with DataTables' ColVis plug-in</a></li>
|
|
475 <li><a href="fixedcolumns.html">Integration with DataTables' FixedColumns plug-in</a></li>
|
|
476 <li><a href="fixedheader.html">Integration with DataTables' FixedHeader plug-in</a></li>
|
|
477 <li><a href="predefined.html">Using a predefined column order set</a></li>
|
|
478 <li><a href="reset.html">Providing a user control to reset the column order</a></li>
|
|
479 <li><a href="scrolling.html">Column reordering shown with scrolling in DataTables</a></li>
|
|
480 <li><a href="server_side.html">Server-side processing support</a></li>
|
|
481 <li><a href="state_save.html">State saving of the column position</a></li>
|
|
482 <li><a href="theme.html">jQuery UI theme integration</a></li>
|
|
483 </ul>
|
|
484
|
|
485
|
|
486 <h1>Initialisation code</h1>
|
|
487 <pre>$(document).ready( function () {
|
|
488 var oTable = $('#example').dataTable( {
|
|
489 "sDom": 'RC<"clear">lfrtip',
|
|
490 "aoColumnDefs": [
|
|
491 { "bVisible": false, "aTargets": [ 1 ] }
|
|
492 ]
|
|
493 } );
|
|
494 } );</pre>
|
|
495
|
|
496 <div id="footer" style="text-align:center;">
|
|
497 <span style="font-size:10px;">
|
|
498 ColReorder and DataTables © Allan Jardine 2010
|
|
499 </span>
|
|
500 </div>
|
|
501 </div>
|
|
502 </body>
|
|
503 </html> |