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 - Restore / show all</title>
9 <link rel="stylesheet" type="text/css" href="../../../media/css/jquery.dataTables.css">
10 <link rel="stylesheet" type="text/css" href="../css/dataTables.colVis.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.colVis.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 $('#example').DataTable( {
26 dom: 'C<"clear">lfrtip',
28 { visible: false, targets: 2 }
42 <body class="dt-example">
43 <div class="container">
45 <h1>ColVis example <span>Restore / show all</span></h1>
48 <p>This demo of ColVis shows its ability to add "Restore", "Show all" and "Show none" buttons to the list of column visibility options. This is done with the
49 <code>restore</code>, <code>showAll</code> and <code>showNone</code> options which can be enabled individually if needed.</p>
51 <p>For full information about the ColVis options, please refer to the <a href="//datatables.net/extensions/colvis/options">ColVis options documentation</a>.</p>
54 <table id="example" class="display" cellspacing="0" width="100%">
80 <td>System Architect</td>
87 <td>Garrett Winters</td>
96 <td>Junior Technical Author</td>
97 <td>San Francisco</td>
103 <td>Cedric Kelly</td>
104 <td>Senior Javascript Developer</td>
119 <td>Brielle Williamson</td>
120 <td>Integration Specialist</td>
127 <td>Herrod Chandler</td>
128 <td>Sales Assistant</td>
129 <td>San Francisco</td>
135 <td>Rhona Davidson</td>
136 <td>Integration Specialist</td>
143 <td>Colleen Hurst</td>
144 <td>Javascript Developer</td>
145 <td>San Francisco</td>
152 <td>Software Engineer</td>
160 <td>Office Manager</td>
168 <td>Support Lead</td>
175 <td>Charde Marshall</td>
176 <td>Regional Director</td>
177 <td>San Francisco</td>
183 <td>Haley Kennedy</td>
184 <td>Senior Marketing Designer</td>
191 <td>Tatyana Fitzpatrick</td>
192 <td>Regional Director</td>
199 <td>Michael Silva</td>
200 <td>Marketing Designer</td>
208 <td>Chief Financial Officer (CFO)</td>
215 <td>Gloria Little</td>
216 <td>Systems Administrator</td>
223 <td>Bradley Greer</td>
224 <td>Software Engineer</td>
232 <td>Personnel Lead</td>
239 <td>Jenette Caldwell</td>
240 <td>Development Lead</td>
248 <td>Chief Marketing Officer (CMO)</td>
255 <td>Caesar Vance</td>
256 <td>Pre-Sales Support</td>
263 <td>Doris Wilder</td>
264 <td>Sales Assistant</td>
271 <td>Angelica Ramos</td>
272 <td>Chief Executive Officer (CEO)</td>
287 <td>Jennifer Chang</td>
288 <td>Regional Director</td>
295 <td>Brenden Wagner</td>
296 <td>Software Engineer</td>
297 <td>San Francisco</td>
304 <td>Chief Operating Officer (COO)</td>
305 <td>San Francisco</td>
312 <td>Regional Marketing</td>
319 <td>Michelle House</td>
320 <td>Integration Specialist</td>
335 <td>Prescott Bartlett</td>
336 <td>Technical Author</td>
343 <td>Gavin Cortez</td>
345 <td>San Francisco</td>
351 <td>Martena Mccray</td>
352 <td>Post-Sales support</td>
359 <td>Unity Butler</td>
360 <td>Marketing Designer</td>
361 <td>San Francisco</td>
367 <td>Howard Hatfield</td>
368 <td>Office Manager</td>
369 <td>San Francisco</td>
375 <td>Hope Fuentes</td>
377 <td>San Francisco</td>
383 <td>Vivian Harrell</td>
384 <td>Financial Controller</td>
385 <td>San Francisco</td>
391 <td>Timothy Mooney</td>
392 <td>Office Manager</td>
399 <td>Jackson Bradshaw</td>
407 <td>Olivia Liang</td>
408 <td>Support Engineer</td>
416 <td>Software Engineer</td>
423 <td>Sakura Yamamoto</td>
424 <td>Support Engineer</td>
439 <td>Finn Camacho</td>
440 <td>Support Engineer</td>
441 <td>San Francisco</td>
447 <td>Serge Baldwin</td>
448 <td>Data Coordinator</td>
455 <td>Zenaida Frank</td>
456 <td>Software Engineer</td>
463 <td>Zorita Serrano</td>
464 <td>Software Engineer</td>
465 <td>San Francisco</td>
471 <td>Jennifer Acosta</td>
472 <td>Junior Javascript Developer</td>
479 <td>Cara Stevens</td>
480 <td>Sales Assistant</td>
487 <td>Hermione Butler</td>
488 <td>Regional Director</td>
496 <td>Systems Administrator</td>
503 <td>Jonas Alexander</td>
505 <td>San Francisco</td>
512 <td>Regional Director</td>
519 <td>Michael Bruce</td>
520 <td>Javascript Developer</td>
527 <td>Donna Snider</td>
528 <td>Customer Support</td>
538 <li class="active">Javascript</li>
542 <li>Server-side script</li>
547 <p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
548 $('#example').DataTable( {
549 dom: 'C<"clear">lfrtip',
551 { visible: false, targets: 2 }
554 restore: "Restore",
555 showAll: "Show all",
556 showNone: "Show none"
561 <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
564 <li><a href="../../../media/js/jquery.js">../../../media/js/jquery.js</a></li>
565 <li><a href="../../../media/js/jquery.dataTables.js">../../../media/js/jquery.dataTables.js</a></li>
566 <li><a href="../js/dataTables.colVis.js">../js/dataTables.colVis.js</a></li>
571 <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
576 <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
577 additional CSS used is shown below:</p><code class="multiline language-css"></code>
580 <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
583 <li><a href="../../../media/css/jquery.dataTables.css">../../../media/css/jquery.dataTables.css</a></li>
584 <li><a href="../css/dataTables.colVis.css">../css/dataTables.colVis.css</a></li>
589 <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
594 <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
595 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables
596 documentation</a>.</p>
604 <div class="gradient"></div>
607 <h2>Other examples</h2>
610 <div class="toc-group">
611 <h3><a href="./index.html">Examples</a></h3>
612 <ul class="toc active">
613 <li><a href="./simple.html">Basic initialisation</a></li>
614 <li><a href="./new_init.html">`new` initialisation</a></li>
615 <li><a href="./text.html">Custom button text</a></li>
616 <li><a href="./exclude_columns.html">Exclude columns from list</a></li>
617 <li><a href="./title_callback.html">Column button callback</a></li>
618 <li><a href="./button_order.html">Button ordering</a></li>
619 <li><a href="./mouseover.html">Mouseover activation</a></li>
620 <li><a href="./group_columns.html">Group columns</a></li>
621 <li><a href="./two_tables.html">Two tables with individual controls</a></li>
622 <li><a href="./two_tables_identical.html">Two tables with shared controls</a></li>
623 <li class="active"><a href="./restore.html">Restore / show all</a></li>
624 <li><a href="./jqueryui.html">jQuery UI styling</a></li>
629 <div class="epilogue">
630 <p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
631 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>
632 which extend the capabilities of DataTables.</p>
634 <p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2015<br>
635 DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>