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 - Complete callback</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, {
28 complete: function ( altered ) {
29 var last = altered[ altered.length-1 ];
31 altered.length+' cells were altered in this auto-fill. The '+
32 'value of the last cell altered was: '+last.oldValue+' and is '+
43 <body class="dt-example">
44 <div class="container">
46 <h1>AutoFill example <span>Complete callback</span></h1>
49 <p>AutoFill provides a number of customisable callback functions so you can tailor it's actions to
50 exactly what you need. This example shows the use of the <code>complete</code> callback function which
51 is executed at the end of an auto-fill drag, providing information about the cells that were
54 <p>For a complete description of the <code>complete</code> callback, please refer to the <a href=
55 "//datatables.net/extras/autofill/options">AutoFill documentation</a>.</p>
58 <table id="example" class="display" cellspacing="0" width="100%">
84 <td>System Architect</td>
91 <td>Garrett Winters</td>
100 <td>Junior Technical Author</td>
101 <td>San Francisco</td>
107 <td>Cedric Kelly</td>
108 <td>Senior Javascript Developer</td>
123 <td>Brielle Williamson</td>
124 <td>Integration Specialist</td>
131 <td>Herrod Chandler</td>
132 <td>Sales Assistant</td>
133 <td>San Francisco</td>
139 <td>Rhona Davidson</td>
140 <td>Integration Specialist</td>
147 <td>Colleen Hurst</td>
148 <td>Javascript Developer</td>
149 <td>San Francisco</td>
156 <td>Software Engineer</td>
164 <td>Office Manager</td>
172 <td>Support Lead</td>
179 <td>Charde Marshall</td>
180 <td>Regional Director</td>
181 <td>San Francisco</td>
187 <td>Haley Kennedy</td>
188 <td>Senior Marketing Designer</td>
195 <td>Tatyana Fitzpatrick</td>
196 <td>Regional Director</td>
203 <td>Michael Silva</td>
204 <td>Marketing Designer</td>
212 <td>Chief Financial Officer (CFO)</td>
219 <td>Gloria Little</td>
220 <td>Systems Administrator</td>
227 <td>Bradley Greer</td>
228 <td>Software Engineer</td>
236 <td>Personnel Lead</td>
243 <td>Jenette Caldwell</td>
244 <td>Development Lead</td>
252 <td>Chief Marketing Officer (CMO)</td>
259 <td>Caesar Vance</td>
260 <td>Pre-Sales Support</td>
267 <td>Doris Wilder</td>
268 <td>Sales Assistant</td>
275 <td>Angelica Ramos</td>
276 <td>Chief Executive Officer (CEO)</td>
291 <td>Jennifer Chang</td>
292 <td>Regional Director</td>
299 <td>Brenden Wagner</td>
300 <td>Software Engineer</td>
301 <td>San Francisco</td>
308 <td>Chief Operating Officer (COO)</td>
309 <td>San Francisco</td>
316 <td>Regional Marketing</td>
323 <td>Michelle House</td>
324 <td>Integration Specialist</td>
339 <td>Prescott Bartlett</td>
340 <td>Technical Author</td>
347 <td>Gavin Cortez</td>
349 <td>San Francisco</td>
355 <td>Martena Mccray</td>
356 <td>Post-Sales support</td>
363 <td>Unity Butler</td>
364 <td>Marketing Designer</td>
365 <td>San Francisco</td>
371 <td>Howard Hatfield</td>
372 <td>Office Manager</td>
373 <td>San Francisco</td>
379 <td>Hope Fuentes</td>
381 <td>San Francisco</td>
387 <td>Vivian Harrell</td>
388 <td>Financial Controller</td>
389 <td>San Francisco</td>
395 <td>Timothy Mooney</td>
396 <td>Office Manager</td>
403 <td>Jackson Bradshaw</td>
411 <td>Olivia Liang</td>
412 <td>Support Engineer</td>
420 <td>Software Engineer</td>
427 <td>Sakura Yamamoto</td>
428 <td>Support Engineer</td>
443 <td>Finn Camacho</td>
444 <td>Support Engineer</td>
445 <td>San Francisco</td>
451 <td>Serge Baldwin</td>
452 <td>Data Coordinator</td>
459 <td>Zenaida Frank</td>
460 <td>Software Engineer</td>
467 <td>Zorita Serrano</td>
468 <td>Software Engineer</td>
469 <td>San Francisco</td>
475 <td>Jennifer Acosta</td>
476 <td>Junior Javascript Developer</td>
483 <td>Cara Stevens</td>
484 <td>Sales Assistant</td>
491 <td>Hermione Butler</td>
492 <td>Regional Director</td>
500 <td>Systems Administrator</td>
507 <td>Jonas Alexander</td>
509 <td>San Francisco</td>
516 <td>Regional Director</td>
523 <td>Michael Bruce</td>
524 <td>Javascript Developer</td>
531 <td>Donna Snider</td>
532 <td>Customer Support</td>
542 <li class="active">Javascript</li>
546 <li>Server-side script</li>
551 <p>The Javascript shown below is used to initialise the table shown in this
552 example:</p><code class="multiline brush: js;">$(document).ready(function() {
553 var table = $('#example').dataTable();
555 new $.fn.dataTable.AutoFill( table, {
556 complete: function ( altered ) {
557 var last = altered[ altered.length-1 ];
559 altered.length+' cells were altered in this auto-fill. The '+
560 'value of the last cell altered was: '+last.oldValue+' and is '+
567 <p>In addition to the above code, the following Javascript library files are loaded for use in this
571 <li><a href="../../../media/js/jquery.js">../../../media/js/jquery.js</a></li>
573 "../../../media/js/jquery.dataTables.js">../../../media/js/jquery.dataTables.js</a></li>
574 <li><a href="../js/dataTables.autoFill.js">../js/dataTables.autoFill.js</a></li>
579 <p>The HTML shown below is the raw HTML table element, before it has been enhanced by
585 <p>This example uses a little bit of additional CSS beyond what is loaded from the library
586 files (below), in order to correctly display the table. The additional CSS used is shown
587 below:</p><code class="multiline brush: js;"></code>
590 <p>The following CSS library files are loaded for use in this example to provide the styling of the
595 "../../../media/css/jquery.dataTables.css">../../../media/css/jquery.dataTables.css</a></li>
596 <li><a href="../css/dataTables.autoFill.css">../css/dataTables.autoFill.css</a></li>
601 <p>This table loads data by Ajax. The latest data that has been loaded is shown below. This data
602 will update automatically as any additional data is loaded.</p>
606 <p>The script used to perform the server-side processing for this table is shown below. Please note
607 that this is just an example script using PHP. Server-side processing scripts can be written in any
608 language, using <a href="//datatables.net/manual/server-side">the protocol described in the
609 DataTables documentation</a>.</p>
617 <div class="gradient"></div>
620 <h2>Other examples</h2>
623 <div class="toc-group">
624 <h3><a href="./index.html">Examples</a></h3>
625 <ul class="toc active">
626 <li><a href="./simple.html">Basic initialisation</a></li>
627 <li><a href="./columns.html">Column options</a></li>
628 <li><a href="./scrolling.html">Scrolling DataTable</a></li>
629 <li><a href="./fill-both.html">Horizontal and vertical fill</a></li>
630 <li><a href="./fill-horizontal.html">Horizontal fill</a></li>
631 <li class="active"><a href="./complete-callback.html">Complete callback</a></li>
632 <li><a href="./step-callback.html">Step callback</a></li>
637 <div class="epilogue">
638 <p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full
639 information about its API properties and methods.<br>
640 Additionally, there are a wide range of <a href="http://www.datatables.net/extras">extras</a> and
641 <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of
644 <p class="copyright">DataTables designed and created by <a href=
645 "http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2014<br>
646 DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>