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>FixedColumns example - ColVis integration</title>
9 <link rel="stylesheet" type="text/css" href="../../../media/css/jquery.dataTables.css">
10 <link rel="stylesheet" type="text/css" href="../../ColVis/css/dataTables.colVis.css">
11 <link rel="stylesheet" type="text/css" href="../css/dataTables.fixedColumns.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">
16 /* Ensure that the demo table scrolls */
17 th, td { white-space: nowrap; }
18 div.dataTables_wrapper {
28 <script type="text/javascript" language="javascript" src="../../../media/js/jquery.js"></script>
29 <script type="text/javascript" language="javascript" src="../../../media/js/jquery.dataTables.js"></script>
30 <script type="text/javascript" language="javascript" src="../../ColVis/js/dataTables.colVis.js"></script>
31 <script type="text/javascript" language="javascript" src="../js/dataTables.fixedColumns.js"></script>
32 <script type="text/javascript" language="javascript" src="../../../examples/resources/syntax/shCore.js"></script>
33 <script type="text/javascript" language="javascript" src="../../../examples/resources/demo.js"></script>
34 <script type="text/javascript" language="javascript" class="init">
37 $(document).ready(function() {
38 var table = $('#example').DataTable( {
46 new $.fn.dataTable.FixedColumns( table, {
55 <body class="dt-example">
56 <div class="container">
58 <h1>FixedColumns example <span>ColVis integration</span></h1>
61 <p>FixedColumns operates with DataTables' built-in column visibility options (<a href="//datatables.net/reference/option/columns.visible"><code class="option"
62 title="DataTables initialisation option">columns.visible<span>DT</span></code></a> and <a href="//datatables.net/reference/api/column().visible()"><code class=
63 "api" title="DataTables API method">column().visible()<span>DT</span></code></a>), which columns that are hidden not being shown in the fixed columns. This
64 integration also means that FixedColumns works well with <a href="http://datatables.net/extensions/colvis">ColVis</a>, with columns that are dynamically shown and
65 hidden updated immediately in the fixed columns.</p>
67 <p>The example below shows ColVis and FixedColumns working together. Two columns have been fixed on the left hand side of the table to show FixedColumns ability to
68 work effortlessly with column visibility.</p>
71 <table id="example" class="stripe row-border order-column" cellspacing="0" width="100%">
90 <td>System Architect</td>
96 <td>t.nixon@datatables.net</td>
107 <td>g.winters@datatables.net</td>
112 <td>Junior Technical Author</td>
113 <td>San Francisco</td>
118 <td>a.cox@datatables.net</td>
123 <td>Senior Javascript Developer</td>
129 <td>c.kelly@datatables.net</td>
140 <td>a.satou@datatables.net</td>
145 <td>Integration Specialist</td>
151 <td>b.williamson@datatables.net</td>
156 <td>Sales Assistant</td>
157 <td>San Francisco</td>
162 <td>h.chandler@datatables.net</td>
167 <td>Integration Specialist</td>
173 <td>r.davidson@datatables.net</td>
178 <td>Javascript Developer</td>
179 <td>San Francisco</td>
184 <td>c.hurst@datatables.net</td>
189 <td>Software Engineer</td>
195 <td>s.frost@datatables.net</td>
200 <td>Office Manager</td>
206 <td>j.gaines@datatables.net</td>
211 <td>Support Lead</td>
217 <td>q.flynn@datatables.net</td>
222 <td>Regional Director</td>
223 <td>San Francisco</td>
228 <td>c.marshall@datatables.net</td>
233 <td>Senior Marketing Designer</td>
239 <td>h.kennedy@datatables.net</td>
244 <td>Regional Director</td>
250 <td>t.fitzpatrick@datatables.net</td>
255 <td>Marketing Designer</td>
261 <td>m.silva@datatables.net</td>
266 <td>Chief Financial Officer (CFO)</td>
272 <td>p.byrd@datatables.net</td>
277 <td>Systems Administrator</td>
283 <td>g.little@datatables.net</td>
288 <td>Software Engineer</td>
294 <td>b.greer@datatables.net</td>
299 <td>Personnel Lead</td>
305 <td>d.rios@datatables.net</td>
310 <td>Development Lead</td>
316 <td>j.caldwell@datatables.net</td>
321 <td>Chief Marketing Officer (CMO)</td>
327 <td>y.berry@datatables.net</td>
332 <td>Pre-Sales Support</td>
338 <td>c.vance@datatables.net</td>
343 <td>Sales Assistant</td>
349 <td>d.wilder@datatables.net</td>
354 <td>Chief Executive Officer (CEO)</td>
360 <td>a.ramos@datatables.net</td>
371 <td>g.joyce@datatables.net</td>
376 <td>Regional Director</td>
382 <td>j.chang@datatables.net</td>
387 <td>Software Engineer</td>
388 <td>San Francisco</td>
393 <td>b.wagner@datatables.net</td>
398 <td>Chief Operating Officer (COO)</td>
399 <td>San Francisco</td>
404 <td>f.green@datatables.net</td>
409 <td>Regional Marketing</td>
415 <td>s.itou@datatables.net</td>
420 <td>Integration Specialist</td>
426 <td>m.house@datatables.net</td>
437 <td>s.burks@datatables.net</td>
442 <td>Technical Author</td>
448 <td>p.bartlett@datatables.net</td>
454 <td>San Francisco</td>
459 <td>g.cortez@datatables.net</td>
464 <td>Post-Sales support</td>
470 <td>m.mccray@datatables.net</td>
475 <td>Marketing Designer</td>
476 <td>San Francisco</td>
481 <td>u.butler@datatables.net</td>
486 <td>Office Manager</td>
487 <td>San Francisco</td>
492 <td>h.hatfield@datatables.net</td>
498 <td>San Francisco</td>
503 <td>h.fuentes@datatables.net</td>
508 <td>Financial Controller</td>
509 <td>San Francisco</td>
514 <td>v.harrell@datatables.net</td>
519 <td>Office Manager</td>
525 <td>t.mooney@datatables.net</td>
536 <td>j.bradshaw@datatables.net</td>
541 <td>Support Engineer</td>
547 <td>o.liang@datatables.net</td>
552 <td>Software Engineer</td>
558 <td>b.nash@datatables.net</td>
563 <td>Support Engineer</td>
569 <td>s.yamamoto@datatables.net</td>
580 <td>t.walton@datatables.net</td>
585 <td>Support Engineer</td>
586 <td>San Francisco</td>
591 <td>f.camacho@datatables.net</td>
596 <td>Data Coordinator</td>
602 <td>s.baldwin@datatables.net</td>
607 <td>Software Engineer</td>
613 <td>z.frank@datatables.net</td>
618 <td>Software Engineer</td>
619 <td>San Francisco</td>
624 <td>z.serrano@datatables.net</td>
629 <td>Junior Javascript Developer</td>
635 <td>j.acosta@datatables.net</td>
640 <td>Sales Assistant</td>
646 <td>c.stevens@datatables.net</td>
651 <td>Regional Director</td>
657 <td>h.butler@datatables.net</td>
662 <td>Systems Administrator</td>
668 <td>l.greer@datatables.net</td>
674 <td>San Francisco</td>
679 <td>j.alexander@datatables.net</td>
684 <td>Regional Director</td>
690 <td>s.decker@datatables.net</td>
695 <td>Javascript Developer</td>
701 <td>m.bruce@datatables.net</td>
706 <td>Customer Support</td>
712 <td>d.snider@datatables.net</td>
718 <li class="active">Javascript</li>
722 <li>Server-side script</li>
727 <p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
728 var table = $('#example').DataTable( {
729 dom: "Cfrtip",
730 scrollY: "300px",
732 scrollCollapse: true,
736 new $.fn.dataTable.FixedColumns( table, {
741 <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
744 <li><a href="../../../media/js/jquery.js">../../../media/js/jquery.js</a></li>
745 <li><a href="../../../media/js/jquery.dataTables.js">../../../media/js/jquery.dataTables.js</a></li>
746 <li><a href="../../ColVis/js/dataTables.colVis.js">../../ColVis/js/dataTables.colVis.js</a></li>
747 <li><a href="../js/dataTables.fixedColumns.js">../js/dataTables.fixedColumns.js</a></li>
752 <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
757 <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
758 additional CSS used is shown below:</p><code class="multiline language-css">/* Ensure that the demo table scrolls */
759 th, td { white-space: nowrap; }
760 div.dataTables_wrapper {
770 <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
773 <li><a href="../../../media/css/jquery.dataTables.css">../../../media/css/jquery.dataTables.css</a></li>
774 <li><a href="../../ColVis/css/dataTables.colVis.css">../../ColVis/css/dataTables.colVis.css</a></li>
775 <li><a href="../css/dataTables.fixedColumns.css">../css/dataTables.fixedColumns.css</a></li>
780 <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
785 <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
786 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables
787 documentation</a>.</p>
795 <div class="gradient"></div>
798 <h2>Other examples</h2>
801 <div class="toc-group">
802 <h3><a href="./index.html">Examples</a></h3>
803 <ul class="toc active">
804 <li><a href="./left_right_columns.html">Left and right fixed columns</a></li>
805 <li><a href="./simple.html">Basic initialisation</a></li>
806 <li><a href="./two_columns.html">Multiple fixed columns</a></li>
807 <li><a href="./right_column.html">Right column only</a></li>
808 <li><a href="./rowspan.html">Complex headers</a></li>
809 <li class="active"><a href="./colvis.html">ColVis integration</a></li>
810 <li><a href="./server-side-processing.html">Server-side processing</a></li>
811 <li><a href="./css_size.html">CSS row sizing</a></li>
812 <li><a href="./size_fixed.html">Assigned column width</a></li>
813 <li><a href="./size_fluid.html">Fluid column width</a></li>
814 <li><a href="./col_filter.html">Individual column filtering</a></li>
815 <li><a href="./bootstrap.html">Bootstrap</a></li>
816 <li><a href="./index_column.html">Index column</a></li>
821 <div class="epilogue">
822 <p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
823 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>
824 which extend the capabilities of DataTables.</p>
826 <p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2015<br>
827 DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>