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 - Server-side processing</title>
9 <link rel="stylesheet" type="text/css" href="../../../media/css/jquery.dataTables.css">
10 <link rel="stylesheet" type="text/css" href="../css/dataTables.fixedColumns.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">
15 /* Ensure that the demo table scrolls */
16 th, td { white-space: nowrap; }
17 div.dataTables_wrapper {
22 /* Lots of padding for the cells as SSP has limited data in the demo */
25 padding-left: 40px !important;
26 padding-right: 40px !important;
30 <script type="text/javascript" language="javascript" src="../../../media/js/jquery.js"></script>
31 <script type="text/javascript" language="javascript" src="../../../media/js/jquery.dataTables.js"></script>
32 <script type="text/javascript" language="javascript" src="../js/dataTables.fixedColumns.js"></script>
33 <script type="text/javascript" language="javascript" src="../../../examples/resources/syntax/shCore.js"></script>
34 <script type="text/javascript" language="javascript" src="../../../examples/resources/demo.js"></script>
35 <script type="text/javascript" language="javascript" class="init">
38 $(document).ready(function() {
39 var table = $('#example').DataTable( {
43 ajax: "../../../examples/server_side/scripts/server_processing.php",
46 new $.fn.dataTable.FixedColumns( table );
53 <body class="dt-example">
54 <div class="container">
56 <h1>FixedColumns example <span>Server-side processing</span></h1>
59 <p>This example shows how FixedColumns can be used with server-side processing in DataTables to cope with very large tables. No special considerations are
60 required, just initialise FixedColumns as you normally would!</p>
62 <p>Note that the table width is constrained in this example to allow scrolling to occur as the server-side processing data set has a limited number of columns in
66 <table id="example" class="stripe row-border order-column" cellspacing="0" width="100%">
91 <li class="active">Javascript</li>
95 <li>Server-side script</li>
100 <p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
101 var table = $('#example').DataTable( {
102 scrollY: "300px",
104 scrollCollapse: true,
105 ajax: "../../../examples/server_side/scripts/server_processing.php",
108 new $.fn.dataTable.FixedColumns( table );
111 <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
114 <li><a href="../../../media/js/jquery.js">../../../media/js/jquery.js</a></li>
115 <li><a href="../../../media/js/jquery.dataTables.js">../../../media/js/jquery.dataTables.js</a></li>
116 <li><a href="../js/dataTables.fixedColumns.js">../js/dataTables.fixedColumns.js</a></li>
121 <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
126 <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
127 additional CSS used is shown below:</p><code class="multiline language-css">/* Ensure that the demo table scrolls */
128 th, td { white-space: nowrap; }
129 div.dataTables_wrapper {
134 /* Lots of padding for the cells as SSP has limited data in the demo */
137 padding-left: 40px !important;
138 padding-right: 40px !important;
142 <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
145 <li><a href="../../../media/css/jquery.dataTables.css">../../../media/css/jquery.dataTables.css</a></li>
146 <li><a href="../css/dataTables.fixedColumns.css">../css/dataTables.fixedColumns.css</a></li>
151 <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
156 <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
157 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables
158 documentation</a>.</p>
166 <div class="gradient"></div>
169 <h2>Other examples</h2>
172 <div class="toc-group">
173 <h3><a href="./index.html">Examples</a></h3>
174 <ul class="toc active">
175 <li><a href="./left_right_columns.html">Left and right fixed columns</a></li>
176 <li><a href="./simple.html">Basic initialisation</a></li>
177 <li><a href="./two_columns.html">Multiple fixed columns</a></li>
178 <li><a href="./right_column.html">Right column only</a></li>
179 <li><a href="./rowspan.html">Complex headers</a></li>
180 <li><a href="./colvis.html">ColVis integration</a></li>
181 <li class="active"><a href="./server-side-processing.html">Server-side processing</a></li>
182 <li><a href="./css_size.html">CSS row sizing</a></li>
183 <li><a href="./size_fixed.html">Assigned column width</a></li>
184 <li><a href="./size_fluid.html">Fluid column width</a></li>
185 <li><a href="./col_filter.html">Individual column filtering</a></li>
186 <li><a href="./bootstrap.html">Bootstrap</a></li>
187 <li><a href="./index_column.html">Index column</a></li>
192 <div class="epilogue">
193 <p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
194 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>
195 which extend the capabilities of DataTables.</p>
197 <p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2015<br>
198 DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>