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>ColVis example - jQuery UI styling</title>
9 <link rel="stylesheet" type="text/css" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css">
10 <link rel="stylesheet" type="text/css" href="../../Plugins/integration/jqueryui/dataTables.jqueryui.css">
11 <link rel="stylesheet" type="text/css" href="../css/dataTables.colvis.jqueryui.css">
12 <link rel="stylesheet" type="text/css" href="../../../examples/resources/syntax/shCore.css">
13 <link rel="stylesheet" type="text/css" href="../../../examples/resources/demo.css">
14 <style type="text/css" class="init">
17 <script type="text/javascript" language="javascript" src="../../../media/js/jquery.js"></script>
18 <script type="text/javascript" language="javascript" src="../../../media/js/jquery.dataTables.js"></script>
19 <script type="text/javascript" language="javascript" src="../../Plugins/integration/jqueryui/dataTables.jqueryui.js"></script>
20 <script type="text/javascript" language="javascript" src="../js/dataTables.colVis.js"></script>
21 <script type="text/javascript" language="javascript" src="../../../examples/resources/syntax/shCore.js"></script>
22 <script type="text/javascript" language="javascript" src="../../../examples/resources/demo.js"></script>
23 <script type="text/javascript" language="javascript" class="init">
26 $(document).ready(function() {
27 var table = $('#example').DataTable( {
30 var colvis = new $.fn.dataTable.ColVis( table );
32 $( colvis.button() ).insertBefore('div.dataTables_length');
39 <body class="dt-example">
40 <div class="container">
42 <h1>ColVis example <span>jQuery UI styling</span></h1>
45 <p>This example shows how the jQuery UI ThemeRoller option in DataTables can be used with ColVis.</p>
47 <p>The important thing to note here is that it is easier to use <code>new $.fn.dataTable.ColVis()</code> to add ColVis to the table rather than <a href=
48 "//datatables.net/reference/option/dom"><code class="option" title="DataTables initialisation option">dom<span>DT</span></code></a> as the jQuery UI integration
49 uses a complex expression for <a href="//datatables.net/reference/option/dom"><code class="option" title=
50 "DataTables initialisation option">dom<span>DT</span></code></a>.</p>
53 <table id="example" class="display" cellspacing="0" width="100%">
79 <td>System Architect</td>
86 <td>Garrett Winters</td>
95 <td>Junior Technical Author</td>
96 <td>San Francisco</td>
102 <td>Cedric Kelly</td>
103 <td>Senior Javascript Developer</td>
118 <td>Brielle Williamson</td>
119 <td>Integration Specialist</td>
126 <td>Herrod Chandler</td>
127 <td>Sales Assistant</td>
128 <td>San Francisco</td>
134 <td>Rhona Davidson</td>
135 <td>Integration Specialist</td>
142 <td>Colleen Hurst</td>
143 <td>Javascript Developer</td>
144 <td>San Francisco</td>
151 <td>Software Engineer</td>
159 <td>Office Manager</td>
167 <td>Support Lead</td>
174 <td>Charde Marshall</td>
175 <td>Regional Director</td>
176 <td>San Francisco</td>
182 <td>Haley Kennedy</td>
183 <td>Senior Marketing Designer</td>
190 <td>Tatyana Fitzpatrick</td>
191 <td>Regional Director</td>
198 <td>Michael Silva</td>
199 <td>Marketing Designer</td>
207 <td>Chief Financial Officer (CFO)</td>
214 <td>Gloria Little</td>
215 <td>Systems Administrator</td>
222 <td>Bradley Greer</td>
223 <td>Software Engineer</td>
231 <td>Personnel Lead</td>
238 <td>Jenette Caldwell</td>
239 <td>Development Lead</td>
247 <td>Chief Marketing Officer (CMO)</td>
254 <td>Caesar Vance</td>
255 <td>Pre-Sales Support</td>
262 <td>Doris Wilder</td>
263 <td>Sales Assistant</td>
270 <td>Angelica Ramos</td>
271 <td>Chief Executive Officer (CEO)</td>
286 <td>Jennifer Chang</td>
287 <td>Regional Director</td>
294 <td>Brenden Wagner</td>
295 <td>Software Engineer</td>
296 <td>San Francisco</td>
303 <td>Chief Operating Officer (COO)</td>
304 <td>San Francisco</td>
311 <td>Regional Marketing</td>
318 <td>Michelle House</td>
319 <td>Integration Specialist</td>
334 <td>Prescott Bartlett</td>
335 <td>Technical Author</td>
342 <td>Gavin Cortez</td>
344 <td>San Francisco</td>
350 <td>Martena Mccray</td>
351 <td>Post-Sales support</td>
358 <td>Unity Butler</td>
359 <td>Marketing Designer</td>
360 <td>San Francisco</td>
366 <td>Howard Hatfield</td>
367 <td>Office Manager</td>
368 <td>San Francisco</td>
374 <td>Hope Fuentes</td>
376 <td>San Francisco</td>
382 <td>Vivian Harrell</td>
383 <td>Financial Controller</td>
384 <td>San Francisco</td>
390 <td>Timothy Mooney</td>
391 <td>Office Manager</td>
398 <td>Jackson Bradshaw</td>
406 <td>Olivia Liang</td>
407 <td>Support Engineer</td>
415 <td>Software Engineer</td>
422 <td>Sakura Yamamoto</td>
423 <td>Support Engineer</td>
438 <td>Finn Camacho</td>
439 <td>Support Engineer</td>
440 <td>San Francisco</td>
446 <td>Serge Baldwin</td>
447 <td>Data Coordinator</td>
454 <td>Zenaida Frank</td>
455 <td>Software Engineer</td>
462 <td>Zorita Serrano</td>
463 <td>Software Engineer</td>
464 <td>San Francisco</td>
470 <td>Jennifer Acosta</td>
471 <td>Junior Javascript Developer</td>
478 <td>Cara Stevens</td>
479 <td>Sales Assistant</td>
486 <td>Hermione Butler</td>
487 <td>Regional Director</td>
495 <td>Systems Administrator</td>
502 <td>Jonas Alexander</td>
504 <td>San Francisco</td>
511 <td>Regional Director</td>
518 <td>Michael Bruce</td>
519 <td>Javascript Developer</td>
526 <td>Donna Snider</td>
527 <td>Customer Support</td>
537 <li class="active">Javascript</li>
541 <li>Server-side script</li>
546 <p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
547 var table = $('#example').DataTable( {
550 var colvis = new $.fn.dataTable.ColVis( table );
552 $( colvis.button() ).insertBefore('div.dataTables_length');
555 <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
558 <li><a href="../../../media/js/jquery.js">../../../media/js/jquery.js</a></li>
559 <li><a href="../../../media/js/jquery.dataTables.js">../../../media/js/jquery.dataTables.js</a></li>
560 <li><a href="../../Plugins/integration/jqueryui/dataTables.jqueryui.js">../../Plugins/integration/jqueryui/dataTables.jqueryui.js</a></li>
561 <li><a href="../js/dataTables.colVis.js">../js/dataTables.colVis.js</a></li>
566 <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
571 <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
572 additional CSS used is shown below:</p><code class="multiline language-css"></code>
575 <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
578 <li><a href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css">//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css</a></li>
579 <li><a href="../../Plugins/integration/jqueryui/dataTables.jqueryui.css">../../Plugins/integration/jqueryui/dataTables.jqueryui.css</a></li>
580 <li><a href="../css/dataTables.colvis.jqueryui.css">../css/dataTables.colvis.jqueryui.css</a></li>
585 <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
590 <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
591 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables
592 documentation</a>.</p>
600 <div class="gradient"></div>
603 <h2>Other examples</h2>
606 <div class="toc-group">
607 <h3><a href="./index.html">Examples</a></h3>
608 <ul class="toc active">
609 <li><a href="./simple.html">Basic initialisation</a></li>
610 <li><a href="./new_init.html">`new` initialisation</a></li>
611 <li><a href="./text.html">Custom button text</a></li>
612 <li><a href="./exclude_columns.html">Exclude columns from list</a></li>
613 <li><a href="./title_callback.html">Column button callback</a></li>
614 <li><a href="./button_order.html">Button ordering</a></li>
615 <li><a href="./mouseover.html">Mouseover activation</a></li>
616 <li><a href="./group_columns.html">Group columns</a></li>
617 <li><a href="./two_tables.html">Two tables with individual controls</a></li>
618 <li><a href="./two_tables_identical.html">Two tables with shared controls</a></li>
619 <li><a href="./restore.html">Restore / show all</a></li>
620 <li class="active"><a href="./jqueryui.html">jQuery UI styling</a></li>
625 <div class="epilogue">
626 <p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
627 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>
628 which extend the capabilities of DataTables.</p>
630 <p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2015<br>
631 DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>