5 <link rel=
"shortcut icon" type=
"image/ico" href=
"http://www.datatables.net/favicon.ico">
6 <meta name=
"viewport" content=
"initial-scale=1.0, maximum-scale=2.0">
8 <title>ColReorder example - Initialisation using `new`
</title>
9 <link rel=
"stylesheet" type=
"text/css" href=
"../../../media/css/jquery.dataTables.css">
10 <link rel=
"stylesheet" type=
"text/css" href=
"../css/dataTables.colReorder.css">
11 <link rel=
"stylesheet" type=
"text/css" href=
"../../../examples/resources/syntax/shCore.css">
12 <link rel=
"stylesheet" type=
"text/css" href=
"../../../examples/resources/demo.css">
13 <style type=
"text/css" class=
"init">
16 <script type=
"text/javascript" language=
"javascript" src=
"../../../media/js/jquery.js"></script>
17 <script type=
"text/javascript" language=
"javascript" src=
"../../../media/js/jquery.dataTables.js"></script>
18 <script type=
"text/javascript" language=
"javascript" src=
"../js/dataTables.colReorder.js"></script>
19 <script type=
"text/javascript" language=
"javascript" src=
"../../../examples/resources/syntax/shCore.js"></script>
20 <script type=
"text/javascript" language=
"javascript" src=
"../../../examples/resources/demo.js"></script>
21 <script type=
"text/javascript" language=
"javascript" class=
"init">
24 $(document).ready(function() {
25 var table = $('#example').DataTable();
27 new $.fn.dataTable.ColReorder( table );
34 <body class=
"dt-example">
35 <div class=
"container">
37 <h1>ColReorder example
<span>Initialisation using `new`
</span></h1>
40 <p>As well as providing the option to be initialised through the
<code>R
</code> option of
<a href=
"//datatables.net/reference/option/dom"><code class=
"option"
41 title=
"DataTables initialisation option">dom
<span>DT
</span></code></a>, ColReorder can also be added to a DataTable using direct initialisation -
<code>new
42 $.fn.dataTable.ColReorder();
</code> as shown in this example.
</p>
45 <table id=
"example" class=
"display" cellspacing=
"0" width=
"100%">
71 <td>System Architect
</td>
78 <td>Garrett Winters
</td>
87 <td>Junior Technical Author
</td>
88 <td>San Francisco
</td>
95 <td>Senior Javascript Developer
</td>
110 <td>Brielle Williamson
</td>
111 <td>Integration Specialist
</td>
118 <td>Herrod Chandler
</td>
119 <td>Sales Assistant
</td>
120 <td>San Francisco
</td>
126 <td>Rhona Davidson
</td>
127 <td>Integration Specialist
</td>
134 <td>Colleen Hurst
</td>
135 <td>Javascript Developer
</td>
136 <td>San Francisco
</td>
143 <td>Software Engineer
</td>
151 <td>Office Manager
</td>
159 <td>Support Lead
</td>
166 <td>Charde Marshall
</td>
167 <td>Regional Director
</td>
168 <td>San Francisco
</td>
174 <td>Haley Kennedy
</td>
175 <td>Senior Marketing Designer
</td>
182 <td>Tatyana Fitzpatrick
</td>
183 <td>Regional Director
</td>
190 <td>Michael Silva
</td>
191 <td>Marketing Designer
</td>
199 <td>Chief Financial Officer (CFO)
</td>
206 <td>Gloria Little
</td>
207 <td>Systems Administrator
</td>
214 <td>Bradley Greer
</td>
215 <td>Software Engineer
</td>
223 <td>Personnel Lead
</td>
230 <td>Jenette Caldwell
</td>
231 <td>Development Lead
</td>
239 <td>Chief Marketing Officer (CMO)
</td>
246 <td>Caesar Vance
</td>
247 <td>Pre-Sales Support
</td>
254 <td>Doris Wilder
</td>
255 <td>Sales Assistant
</td>
262 <td>Angelica Ramos
</td>
263 <td>Chief Executive Officer (CEO)
</td>
278 <td>Jennifer Chang
</td>
279 <td>Regional Director
</td>
286 <td>Brenden Wagner
</td>
287 <td>Software Engineer
</td>
288 <td>San Francisco
</td>
295 <td>Chief Operating Officer (COO)
</td>
296 <td>San Francisco
</td>
303 <td>Regional Marketing
</td>
310 <td>Michelle House
</td>
311 <td>Integration Specialist
</td>
326 <td>Prescott Bartlett
</td>
327 <td>Technical Author
</td>
334 <td>Gavin Cortez
</td>
336 <td>San Francisco
</td>
342 <td>Martena Mccray
</td>
343 <td>Post-Sales support
</td>
350 <td>Unity Butler
</td>
351 <td>Marketing Designer
</td>
352 <td>San Francisco
</td>
358 <td>Howard Hatfield
</td>
359 <td>Office Manager
</td>
360 <td>San Francisco
</td>
366 <td>Hope Fuentes
</td>
368 <td>San Francisco
</td>
374 <td>Vivian Harrell
</td>
375 <td>Financial Controller
</td>
376 <td>San Francisco
</td>
382 <td>Timothy Mooney
</td>
383 <td>Office Manager
</td>
390 <td>Jackson Bradshaw
</td>
398 <td>Olivia Liang
</td>
399 <td>Support Engineer
</td>
407 <td>Software Engineer
</td>
414 <td>Sakura Yamamoto
</td>
415 <td>Support Engineer
</td>
430 <td>Finn Camacho
</td>
431 <td>Support Engineer
</td>
432 <td>San Francisco
</td>
438 <td>Serge Baldwin
</td>
439 <td>Data Coordinator
</td>
446 <td>Zenaida Frank
</td>
447 <td>Software Engineer
</td>
454 <td>Zorita Serrano
</td>
455 <td>Software Engineer
</td>
456 <td>San Francisco
</td>
462 <td>Jennifer Acosta
</td>
463 <td>Junior Javascript Developer
</td>
470 <td>Cara Stevens
</td>
471 <td>Sales Assistant
</td>
478 <td>Hermione Butler
</td>
479 <td>Regional Director
</td>
487 <td>Systems Administrator
</td>
494 <td>Jonas Alexander
</td>
496 <td>San Francisco
</td>
503 <td>Regional Director
</td>
510 <td>Michael Bruce
</td>
511 <td>Javascript Developer
</td>
518 <td>Donna Snider
</td>
519 <td>Customer Support
</td>
529 <li class=
"active">Javascript
</li>
533 <li>Server-side script
</li>
538 <p>The Javascript shown below is used to initialise the table shown in this example:
</p><code class=
"multiline language-js">$(document).ready(function() {
539 var table = $('#example').DataTable();
541 new $.fn.dataTable.ColReorder( table );
544 <p>In addition to the above code, the following Javascript library files are loaded for use in this example:
</p>
547 <li><a href=
"../../../media/js/jquery.js">../../../media/js/jquery.js
</a></li>
548 <li><a href=
"../../../media/js/jquery.dataTables.js">../../../media/js/jquery.dataTables.js
</a></li>
549 <li><a href=
"../js/dataTables.colReorder.js">../js/dataTables.colReorder.js
</a></li>
554 <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:
</p>
559 <p>This example uses a little bit of additional CSS beyond what is loaded from the library files (below), in order to correctly display the table. The
560 additional CSS used is shown below:
</p><code class=
"multiline language-css"></code>
563 <p>The following CSS library files are loaded for use in this example to provide the styling of the table:
</p>
566 <li><a href=
"../../../media/css/jquery.dataTables.css">../../../media/css/jquery.dataTables.css
</a></li>
567 <li><a href=
"../css/dataTables.colReorder.css">../css/dataTables.colReorder.css
</a></li>
572 <p>This table loads data by Ajax. The latest data that has been loaded is shown below. This data will update automatically as any additional data is
577 <p>The script used to perform the server-side processing for this table is shown below. Please note that this is just an example script using PHP. Server-side
578 processing scripts can be written in any language, using
<a href=
"//datatables.net/manual/server-side">the protocol described in the DataTables
579 documentation
</a>.
</p>
587 <div class=
"gradient"></div>
590 <h2>Other examples
</h2>
593 <div class=
"toc-group">
594 <h3><a href=
"./index.html">Examples
</a></h3>
595 <ul class=
"toc active">
596 <li><a href=
"./simple.html">Basic initialisation
</a></li>
597 <li class=
"active"><a href=
"./new_init.html">Initialisation using `new`
</a></li>
598 <li><a href=
"./alt_insert.html">Alternative insert styling
</a></li>
599 <li><a href=
"./realtime.html">Realtime updating
</a></li>
600 <li><a href=
"./state_save.html">State saving
</a></li>
601 <li><a href=
"./scrolling.html">Scrolling table
</a></li>
602 <li><a href=
"./predefined.html">Predefined column ordering
</a></li>
603 <li><a href=
"./reset.html">Reset ordering API
</a></li>
604 <li><a href=
"./colvis.html">ColVis integration
</a></li>
605 <li><a href=
"./fixedcolumns.html">FixedColumns integration
</a></li>
606 <li><a href=
"./fixedheader.html">FixedHeader integration
</a></li>
607 <li><a href=
"./jqueryui.html">jQuery UI styling
</a></li>
608 <li><a href=
"./col_filter.html">Individual column filtering
</a></li>
609 <li><a href=
"./server_side.html">Server-side processing
</a></li>
614 <div class=
"epilogue">
615 <p>Please refer to the
<a href=
"http://www.datatables.net">DataTables documentation
</a> for full information about its API properties and methods.
<br>
616 Additionally, there are a wide range of
<a href=
"http://www.datatables.net/extras">extras
</a> and
<a href=
"http://www.datatables.net/plug-ins">plug-ins
</a>
617 which extend the capabilities of DataTables.
</p>
619 <p class=
"copyright">DataTables designed and created by
<a href=
"http://www.sprymedia.co.uk">SpryMedia Ltd
</a> © 2007-
2015<br>
620 DataTables is licensed under the
<a href=
"http://www.datatables.net/mit">MIT license
</a>.
</p>