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>AutoFill example - Column options</title>
9 <link rel="stylesheet" type="text/css" href="../../../media/css/jquery.dataTables.css">
10 <link rel="stylesheet" type="text/css" href="../css/dataTables.autoFill.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.autoFill.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.AutoFill( table, {
29 { enable: false, targets: [-1, -2] },
30 { increment: false, targets: 3 }
39 <body class="dt-example">
40 <div class="container">
42 <h1>AutoFill example <span>Column options</span></h1>
45 <p>Columns can be enabled (which they are by default) and disabled from providing the end user with
46 AutoFill abilities by using either <code>columns</code> or <code>columnDefs</code> and the
47 <code>enable</code> option. These two arrays work in exactly the same way <a href=
48 "http://datatables.net/ref/columns">as in DataTables</a>.</p>
50 <p>This example shows how disabling columns counting from the right hand side of the table can be
51 achieved. In this case, the last three columns.</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
548 example:</p><code class="multiline brush: js;">$(document).ready(function() {
549 var table = $('#example').dataTable();
551 new $.fn.dataTable.AutoFill( table, {
552 "columnDefs": [
553 { enable: false, targets: [-1, -2] },
554 { increment: false, targets: 3 }
559 <p>In addition to the above code, the following Javascript library files are loaded for use in this
563 <li><a href="../../../media/js/jquery.js">../../../media/js/jquery.js</a></li>
565 "../../../media/js/jquery.dataTables.js">../../../media/js/jquery.dataTables.js</a></li>
566 <li><a href="../js/dataTables.autoFill.js">../js/dataTables.autoFill.js</a></li>
571 <p>The HTML shown below is the raw HTML table element, before it has been enhanced by
577 <p>This example uses a little bit of additional CSS beyond what is loaded from the library
578 files (below), in order to correctly display the table. The additional CSS used is shown
579 below:</p><code class="multiline brush: js;"></code>
582 <p>The following CSS library files are loaded for use in this example to provide the styling of the
587 "../../../media/css/jquery.dataTables.css">../../../media/css/jquery.dataTables.css</a></li>
588 <li><a href="../css/dataTables.autoFill.css">../css/dataTables.autoFill.css</a></li>
593 <p>This table loads data by Ajax. The latest data that has been loaded is shown below. This data
594 will update automatically as any additional data is loaded.</p>
598 <p>The script used to perform the server-side processing for this table is shown below. Please note
599 that this is just an example script using PHP. Server-side processing scripts can be written in any
600 language, using <a href="//datatables.net/manual/server-side">the protocol described in the
601 DataTables documentation</a>.</p>
609 <div class="gradient"></div>
612 <h2>Other examples</h2>
615 <div class="toc-group">
616 <h3><a href="./index.html">Examples</a></h3>
617 <ul class="toc active">
618 <li><a href="./simple.html">Basic initialisation</a></li>
619 <li class="active"><a href="./columns.html">Column options</a></li>
620 <li><a href="./scrolling.html">Scrolling DataTable</a></li>
621 <li><a href="./fill-both.html">Horizontal and vertical fill</a></li>
622 <li><a href="./fill-horizontal.html">Horizontal fill</a></li>
623 <li><a href="./complete-callback.html">Complete callback</a></li>
624 <li><a href="./step-callback.html">Step callback</a></li>
629 <div class="epilogue">
630 <p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full
631 information about its API properties and methods.<br>
632 Additionally, there are a wide range of <a href="http://www.datatables.net/extras">extras</a> and
633 <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of
636 <p class="copyright">DataTables designed and created by <a href=
637 "http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2014<br>
638 DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>