1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-02-21 19:54:15 +01:00

Remove prefixed -moz-box-sizing (not needed since ff 29)

https://developer.mozilla.org/en-US/Firefox/Releases/29
This commit is contained in:
Allan Jardine 2016-12-02 16:46:11 +00:00
parent 130687eeef
commit 321be3bdb3
121 changed files with 19859 additions and 71876 deletions

View File

@ -1 +1 @@
70237790a1832fe8352a2bbda66d85afa5f1deb0 e468e3e4ce459e647bb9b2fbf20e6d9fc148e198

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,905 +1,687 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<title>DataTables example - HTML5 data-* attributes - table options</title>
<link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"> <title>DataTables example - HTML5 data-* attributes - table options</title>
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"><link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<style type="text/css" class="init"> <style type="text/css" class="init">
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <script type="text/javascript" language="javascript" class="init">
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() { $(document).ready(function() {
$('#example').DataTable(); $('#example').DataTable();
} ); } );
</script> </script>
</head> </head>
<body class="dt-example"> <body class="dt-example ">
<div class="container"> <div class="container">
<section> <section>
<h1>DataTables example <span>HTML5 data-* attributes - table options</span></h1> <h1>DataTables example <span>HTML5 data-* attributes - table options</span></h1>
<div class="info"> <div class="info">
<p>As of DataTables 1.10.5 it is now possible to define <a href="//datatables.net/reference/option">initialisation options</a> using HTML5 <code>data-*</code> <p>As of DataTables 1.10.5 it is now possible to define <a href="//datatables.net/reference/option">initialisation options</a> using HTML5 <code>data-*</code> attributes. The attribute names are read by DataTables and used, potentially in combination with, the standard Javascript initialisation options (with the <code>data-*</code> attributes taking priority).</p>
attributes. The attribute names are read by DataTables and used, potentially in combination with, the standard Javascript initialisation options (with the
<code>data-*</code> attributes taking priority).</p> <p>Please note that the attribute values must contain valid JSON data or a Javascript primitive (as require by <a href="http://api.jquery.com/data/#data-html5">jQuery's <code>$().data()</code> method</a> - this means that double quotes should be used inside the attribute if needed for a string (see the <code>data-order</code> example below).</p>
<p>Please note that the attribute values must contain valid JSON data or a Javascript primitive (as require by <a href=
"http://api.jquery.com/data/#data-html5">jQuery's <code>$().data()</code> method</a> - this means that double quotes should be used inside the attribute if needed <p>Additionally, jQuery will convert a dashed string into the camel-case notation used by DataTables for its options. For example <code>data-page-length</code> is used to represent <a href="//datatables.net/reference/option/pageLength"><code class="option" title="DataTables initialisation option">pageLength</code></a>.</p>
for a string (see the <code>data-order</code> example below).</p>
<p>Additionally, jQuery will convert a dashed string into the camel-case notation used by DataTables for its options. For example <code>data-page-length</code> is <p>The table below shows the use of <a href="//datatables.net/reference/option/pageLength"><code class="option" title="DataTables initialisation option">pageLength</code></a> and <a href="//datatables.net/reference/option/order"><code class="option" title="DataTables initialisation option">order</code></a> on the main table. Column options can also be defined on the table column cells, as shown by the use of the <a href="//datatables.net/reference/option/columns.orderable"><code class="option" title="DataTables initialisation option">columns.orderable</code></a> option on the fifth column below.</p>
used to represent <a href="//datatables.net/reference/option/pageLength"><code class="option" title="DataTables initialisation option">pageLength</code></a>.</p>
<p>The table below shows the use of <a href="//datatables.net/reference/option/pageLength"><code class="option" title= </div>
"DataTables initialisation option">pageLength</code></a> and <a href="//datatables.net/reference/option/order"><code class="option" title=
"DataTables initialisation option">order</code></a> on the main table. Column options can also be defined on the table column cells, as shown by the use of the
<a href="//datatables.net/reference/option/columns.orderable"><code class="option" title="DataTables initialisation option">columns.orderable</code></a> option on <table id="example" class="display" width="100%" data-page-length="25" data-order="[[ 1, &quot;asc&quot; ]]">
the fifth column below.</p> <thead>
</div> <tr>
<table id="example" class="display" width="100%" data-page-length="25" data-order="[[ 1, &quot;asc&quot; ]]"> <th>Name</th>
<thead> <th>Position</th>
<tr> <th>Office</th>
<th>Name</th> <th>Age</th>
<th>Position</th> <th data-orderable="false">Start date</th>
<th>Office</th> <th>Salary</th>
<th>Age</th> </tr>
<th data-orderable="false">Start date</th> </thead>
<th>Salary</th>
</tr> <tfoot>
</thead> <tr>
<tfoot> <th>Name</th>
<tr> <th>Position</th>
<th>Name</th> <th>Office</th>
<th>Position</th> <th>Age</th>
<th>Office</th> <th>Start date</th>
<th>Age</th> <th>Salary</th>
<th>Start date</th> </tr>
<th>Salary</th> </tfoot>
</tr>
</tfoot> <tbody>
<tbody> <tr>
<tr> <td>Tiger Nixon</td>
<td>Tiger Nixon</td> <td>System Architect</td>
<td>System Architect</td> <td>Edinburgh</td>
<td>Edinburgh</td> <td>61</td>
<td>61</td> <td>2011/04/25</td>
<td>2011/04/25</td> <td>$320,800</td>
<td>$320,800</td> </tr>
</tr> <tr>
<tr> <td>Garrett Winters</td>
<td>Garrett Winters</td> <td>Accountant</td>
<td>Accountant</td> <td>Tokyo</td>
<td>Tokyo</td> <td>63</td>
<td>63</td> <td>2011/07/25</td>
<td>2011/07/25</td> <td>$170,750</td>
<td>$170,750</td> </tr>
</tr> <tr>
<tr> <td>Ashton Cox</td>
<td>Ashton Cox</td> <td>Junior Technical Author</td>
<td>Junior Technical Author</td> <td>San Francisco</td>
<td>San Francisco</td> <td>66</td>
<td>66</td> <td>2009/01/12</td>
<td>2009/01/12</td> <td>$86,000</td>
<td>$86,000</td> </tr>
</tr> <tr>
<tr> <td>Cedric Kelly</td>
<td>Cedric Kelly</td> <td>Senior Javascript Developer</td>
<td>Senior Javascript Developer</td> <td>Edinburgh</td>
<td>Edinburgh</td> <td>22</td>
<td>22</td> <td>2012/03/29</td>
<td>2012/03/29</td> <td>$433,060</td>
<td>$433,060</td> </tr>
</tr> <tr>
<tr> <td>Airi Satou</td>
<td>Airi Satou</td> <td>Accountant</td>
<td>Accountant</td> <td>Tokyo</td>
<td>Tokyo</td> <td>33</td>
<td>33</td> <td>2008/11/28</td>
<td>2008/11/28</td> <td>$162,700</td>
<td>$162,700</td> </tr>
</tr> <tr>
<tr> <td>Brielle Williamson</td>
<td>Brielle Williamson</td> <td>Integration Specialist</td>
<td>Integration Specialist</td> <td>New York</td>
<td>New York</td> <td>61</td>
<td>61</td> <td>2012/12/02</td>
<td>2012/12/02</td> <td>$372,000</td>
<td>$372,000</td> </tr>
</tr> <tr>
<tr> <td>Herrod Chandler</td>
<td>Herrod Chandler</td> <td>Sales Assistant</td>
<td>Sales Assistant</td> <td>San Francisco</td>
<td>San Francisco</td> <td>59</td>
<td>59</td> <td>2012/08/06</td>
<td>2012/08/06</td> <td>$137,500</td>
<td>$137,500</td> </tr>
</tr> <tr>
<tr> <td>Rhona Davidson</td>
<td>Rhona Davidson</td> <td>Integration Specialist</td>
<td>Integration Specialist</td> <td>Tokyo</td>
<td>Tokyo</td> <td>55</td>
<td>55</td> <td>2010/10/14</td>
<td>2010/10/14</td> <td>$327,900</td>
<td>$327,900</td> </tr>
</tr> <tr>
<tr> <td>Colleen Hurst</td>
<td>Colleen Hurst</td> <td>Javascript Developer</td>
<td>Javascript Developer</td> <td>San Francisco</td>
<td>San Francisco</td> <td>39</td>
<td>39</td> <td>2009/09/15</td>
<td>2009/09/15</td> <td>$205,500</td>
<td>$205,500</td> </tr>
</tr> <tr>
<tr> <td>Sonya Frost</td>
<td>Sonya Frost</td> <td>Software Engineer</td>
<td>Software Engineer</td> <td>Edinburgh</td>
<td>Edinburgh</td> <td>23</td>
<td>23</td> <td>2008/12/13</td>
<td>2008/12/13</td> <td>$103,600</td>
<td>$103,600</td> </tr>
</tr> <tr>
<tr> <td>Jena Gaines</td>
<td>Jena Gaines</td> <td>Office Manager</td>
<td>Office Manager</td> <td>London</td>
<td>London</td> <td>30</td>
<td>30</td> <td>2008/12/19</td>
<td>2008/12/19</td> <td>$90,560</td>
<td>$90,560</td> </tr>
</tr> <tr>
<tr> <td>Quinn Flynn</td>
<td>Quinn Flynn</td> <td>Support Lead</td>
<td>Support Lead</td> <td>Edinburgh</td>
<td>Edinburgh</td> <td>22</td>
<td>22</td> <td>2013/03/03</td>
<td>2013/03/03</td> <td>$342,000</td>
<td>$342,000</td> </tr>
</tr> <tr>
<tr> <td>Charde Marshall</td>
<td>Charde Marshall</td> <td>Regional Director</td>
<td>Regional Director</td> <td>San Francisco</td>
<td>San Francisco</td> <td>36</td>
<td>36</td> <td>2008/10/16</td>
<td>2008/10/16</td> <td>$470,600</td>
<td>$470,600</td> </tr>
</tr> <tr>
<tr> <td>Haley Kennedy</td>
<td>Haley Kennedy</td> <td>Senior Marketing Designer</td>
<td>Senior Marketing Designer</td> <td>London</td>
<td>London</td> <td>43</td>
<td>43</td> <td>2012/12/18</td>
<td>2012/12/18</td> <td>$313,500</td>
<td>$313,500</td> </tr>
</tr> <tr>
<tr> <td>Tatyana Fitzpatrick</td>
<td>Tatyana Fitzpatrick</td> <td>Regional Director</td>
<td>Regional Director</td> <td>London</td>
<td>London</td> <td>19</td>
<td>19</td> <td>2010/03/17</td>
<td>2010/03/17</td> <td>$385,750</td>
<td>$385,750</td> </tr>
</tr> <tr>
<tr> <td>Michael Silva</td>
<td>Michael Silva</td> <td>Marketing Designer</td>
<td>Marketing Designer</td> <td>London</td>
<td>London</td> <td>66</td>
<td>66</td> <td>2012/11/27</td>
<td>2012/11/27</td> <td>$198,500</td>
<td>$198,500</td> </tr>
</tr> <tr>
<tr> <td>Paul Byrd</td>
<td>Paul Byrd</td> <td>Chief Financial Officer (CFO)</td>
<td>Chief Financial Officer (CFO)</td> <td>New York</td>
<td>New York</td> <td>64</td>
<td>64</td> <td>2010/06/09</td>
<td>2010/06/09</td> <td>$725,000</td>
<td>$725,000</td> </tr>
</tr> <tr>
<tr> <td>Gloria Little</td>
<td>Gloria Little</td> <td>Systems Administrator</td>
<td>Systems Administrator</td> <td>New York</td>
<td>New York</td> <td>59</td>
<td>59</td> <td>2009/04/10</td>
<td>2009/04/10</td> <td>$237,500</td>
<td>$237,500</td> </tr>
</tr> <tr>
<tr> <td>Bradley Greer</td>
<td>Bradley Greer</td> <td>Software Engineer</td>
<td>Software Engineer</td> <td>London</td>
<td>London</td> <td>41</td>
<td>41</td> <td>2012/10/13</td>
<td>2012/10/13</td> <td>$132,000</td>
<td>$132,000</td> </tr>
</tr> <tr>
<tr> <td>Dai Rios</td>
<td>Dai Rios</td> <td>Personnel Lead</td>
<td>Personnel Lead</td> <td>Edinburgh</td>
<td>Edinburgh</td> <td>35</td>
<td>35</td> <td>2012/09/26</td>
<td>2012/09/26</td> <td>$217,500</td>
<td>$217,500</td> </tr>
</tr> <tr>
<tr> <td>Jenette Caldwell</td>
<td>Jenette Caldwell</td> <td>Development Lead</td>
<td>Development Lead</td> <td>New York</td>
<td>New York</td> <td>30</td>
<td>30</td> <td>2011/09/03</td>
<td>2011/09/03</td> <td>$345,000</td>
<td>$345,000</td> </tr>
</tr> <tr>
<tr> <td>Yuri Berry</td>
<td>Yuri Berry</td> <td>Chief Marketing Officer (CMO)</td>
<td>Chief Marketing Officer (CMO)</td> <td>New York</td>
<td>New York</td> <td>40</td>
<td>40</td> <td>2009/06/25</td>
<td>2009/06/25</td> <td>$675,000</td>
<td>$675,000</td> </tr>
</tr> <tr>
<tr> <td>Caesar Vance</td>
<td>Caesar Vance</td> <td>Pre-Sales Support</td>
<td>Pre-Sales Support</td> <td>New York</td>
<td>New York</td> <td>21</td>
<td>21</td> <td>2011/12/12</td>
<td>2011/12/12</td> <td>$106,450</td>
<td>$106,450</td> </tr>
</tr> <tr>
<tr> <td>Doris Wilder</td>
<td>Doris Wilder</td> <td>Sales Assistant</td>
<td>Sales Assistant</td> <td>Sidney</td>
<td>Sidney</td> <td>23</td>
<td>23</td> <td>2010/09/20</td>
<td>2010/09/20</td> <td>$85,600</td>
<td>$85,600</td> </tr>
</tr> <tr>
<tr> <td>Angelica Ramos</td>
<td>Angelica Ramos</td> <td>Chief Executive Officer (CEO)</td>
<td>Chief Executive Officer (CEO)</td> <td>London</td>
<td>London</td> <td>47</td>
<td>47</td> <td>2009/10/09</td>
<td>2009/10/09</td> <td>$1,200,000</td>
<td>$1,200,000</td> </tr>
</tr> <tr>
<tr> <td>Gavin Joyce</td>
<td>Gavin Joyce</td> <td>Developer</td>
<td>Developer</td> <td>Edinburgh</td>
<td>Edinburgh</td> <td>42</td>
<td>42</td> <td>2010/12/22</td>
<td>2010/12/22</td> <td>$92,575</td>
<td>$92,575</td> </tr>
</tr> <tr>
<tr> <td>Jennifer Chang</td>
<td>Jennifer Chang</td> <td>Regional Director</td>
<td>Regional Director</td> <td>Singapore</td>
<td>Singapore</td> <td>28</td>
<td>28</td> <td>2010/11/14</td>
<td>2010/11/14</td> <td>$357,650</td>
<td>$357,650</td> </tr>
</tr> <tr>
<tr> <td>Brenden Wagner</td>
<td>Brenden Wagner</td> <td>Software Engineer</td>
<td>Software Engineer</td> <td>San Francisco</td>
<td>San Francisco</td> <td>28</td>
<td>28</td> <td>2011/06/07</td>
<td>2011/06/07</td> <td>$206,850</td>
<td>$206,850</td> </tr>
</tr> <tr>
<tr> <td>Fiona Green</td>
<td>Fiona Green</td> <td>Chief Operating Officer (COO)</td>
<td>Chief Operating Officer (COO)</td> <td>San Francisco</td>
<td>San Francisco</td> <td>48</td>
<td>48</td> <td>2010/03/11</td>
<td>2010/03/11</td> <td>$850,000</td>
<td>$850,000</td> </tr>
</tr> <tr>
<tr> <td>Shou Itou</td>
<td>Shou Itou</td> <td>Regional Marketing</td>
<td>Regional Marketing</td> <td>Tokyo</td>
<td>Tokyo</td> <td>20</td>
<td>20</td> <td>2011/08/14</td>
<td>2011/08/14</td> <td>$163,000</td>
<td>$163,000</td> </tr>
</tr> <tr>
<tr> <td>Michelle House</td>
<td>Michelle House</td> <td>Integration Specialist</td>
<td>Integration Specialist</td> <td>Sidney</td>
<td>Sidney</td> <td>37</td>
<td>37</td> <td>2011/06/02</td>
<td>2011/06/02</td> <td>$95,400</td>
<td>$95,400</td> </tr>
</tr> <tr>
<tr> <td>Suki Burks</td>
<td>Suki Burks</td> <td>Developer</td>
<td>Developer</td> <td>London</td>
<td>London</td> <td>53</td>
<td>53</td> <td>2009/10/22</td>
<td>2009/10/22</td> <td>$114,500</td>
<td>$114,500</td> </tr>
</tr> <tr>
<tr> <td>Prescott Bartlett</td>
<td>Prescott Bartlett</td> <td>Technical Author</td>
<td>Technical Author</td> <td>London</td>
<td>London</td> <td>27</td>
<td>27</td> <td>2011/05/07</td>
<td>2011/05/07</td> <td>$145,000</td>
<td>$145,000</td> </tr>
</tr> <tr>
<tr> <td>Gavin Cortez</td>
<td>Gavin Cortez</td> <td>Team Leader</td>
<td>Team Leader</td> <td>San Francisco</td>
<td>San Francisco</td> <td>22</td>
<td>22</td> <td>2008/10/26</td>
<td>2008/10/26</td> <td>$235,500</td>
<td>$235,500</td> </tr>
</tr> <tr>
<tr> <td>Martena Mccray</td>
<td>Martena Mccray</td> <td>Post-Sales support</td>
<td>Post-Sales support</td> <td>Edinburgh</td>
<td>Edinburgh</td> <td>46</td>
<td>46</td> <td>2011/03/09</td>
<td>2011/03/09</td> <td>$324,050</td>
<td>$324,050</td> </tr>
</tr> <tr>
<tr> <td>Unity Butler</td>
<td>Unity Butler</td> <td>Marketing Designer</td>
<td>Marketing Designer</td> <td>San Francisco</td>
<td>San Francisco</td> <td>47</td>
<td>47</td> <td>2009/12/09</td>
<td>2009/12/09</td> <td>$85,675</td>
<td>$85,675</td> </tr>
</tr> <tr>
<tr> <td>Howard Hatfield</td>
<td>Howard Hatfield</td> <td>Office Manager</td>
<td>Office Manager</td> <td>San Francisco</td>
<td>San Francisco</td> <td>51</td>
<td>51</td> <td>2008/12/16</td>
<td>2008/12/16</td> <td>$164,500</td>
<td>$164,500</td> </tr>
</tr> <tr>
<tr> <td>Hope Fuentes</td>
<td>Hope Fuentes</td> <td>Secretary</td>
<td>Secretary</td> <td>San Francisco</td>
<td>San Francisco</td> <td>41</td>
<td>41</td> <td>2010/02/12</td>
<td>2010/02/12</td> <td>$109,850</td>
<td>$109,850</td> </tr>
</tr> <tr>
<tr> <td>Vivian Harrell</td>
<td>Vivian Harrell</td> <td>Financial Controller</td>
<td>Financial Controller</td> <td>San Francisco</td>
<td>San Francisco</td> <td>62</td>
<td>62</td> <td>2009/02/14</td>
<td>2009/02/14</td> <td>$452,500</td>
<td>$452,500</td> </tr>
</tr> <tr>
<tr> <td>Timothy Mooney</td>
<td>Timothy Mooney</td> <td>Office Manager</td>
<td>Office Manager</td> <td>London</td>
<td>London</td> <td>37</td>
<td>37</td> <td>2008/12/11</td>
<td>2008/12/11</td> <td>$136,200</td>
<td>$136,200</td> </tr>
</tr> <tr>
<tr> <td>Jackson Bradshaw</td>
<td>Jackson Bradshaw</td> <td>Director</td>
<td>Director</td> <td>New York</td>
<td>New York</td> <td>65</td>
<td>65</td> <td>2008/09/26</td>
<td>2008/09/26</td> <td>$645,750</td>
<td>$645,750</td> </tr>
</tr> <tr>
<tr> <td>Olivia Liang</td>
<td>Olivia Liang</td> <td>Support Engineer</td>
<td>Support Engineer</td> <td>Singapore</td>
<td>Singapore</td> <td>64</td>
<td>64</td> <td>2011/02/03</td>
<td>2011/02/03</td> <td>$234,500</td>
<td>$234,500</td> </tr>
</tr> <tr>
<tr> <td>Bruno Nash</td>
<td>Bruno Nash</td> <td>Software Engineer</td>
<td>Software Engineer</td> <td>London</td>
<td>London</td> <td>38</td>
<td>38</td> <td>2011/05/03</td>
<td>2011/05/03</td> <td>$163,500</td>
<td>$163,500</td> </tr>
</tr> <tr>
<tr> <td>Sakura Yamamoto</td>
<td>Sakura Yamamoto</td> <td>Support Engineer</td>
<td>Support Engineer</td> <td>Tokyo</td>
<td>Tokyo</td> <td>37</td>
<td>37</td> <td>2009/08/19</td>
<td>2009/08/19</td> <td>$139,575</td>
<td>$139,575</td> </tr>
</tr> <tr>
<tr> <td>Thor Walton</td>
<td>Thor Walton</td> <td>Developer</td>
<td>Developer</td> <td>New York</td>
<td>New York</td> <td>61</td>
<td>61</td> <td>2013/08/11</td>
<td>2013/08/11</td> <td>$98,540</td>
<td>$98,540</td> </tr>
</tr> <tr>
<tr> <td>Finn Camacho</td>
<td>Finn Camacho</td> <td>Support Engineer</td>
<td>Support Engineer</td> <td>San Francisco</td>
<td>San Francisco</td> <td>47</td>
<td>47</td> <td>2009/07/07</td>
<td>2009/07/07</td> <td>$87,500</td>
<td>$87,500</td> </tr>
</tr> <tr>
<tr> <td>Serge Baldwin</td>
<td>Serge Baldwin</td> <td>Data Coordinator</td>
<td>Data Coordinator</td> <td>Singapore</td>
<td>Singapore</td> <td>64</td>
<td>64</td> <td>2012/04/09</td>
<td>2012/04/09</td> <td>$138,575</td>
<td>$138,575</td> </tr>
</tr> <tr>
<tr> <td>Zenaida Frank</td>
<td>Zenaida Frank</td> <td>Software Engineer</td>
<td>Software Engineer</td> <td>New York</td>
<td>New York</td> <td>63</td>
<td>63</td> <td>2010/01/04</td>
<td>2010/01/04</td> <td>$125,250</td>
<td>$125,250</td> </tr>
</tr> <tr>
<tr> <td>Zorita Serrano</td>
<td>Zorita Serrano</td> <td>Software Engineer</td>
<td>Software Engineer</td> <td>San Francisco</td>
<td>San Francisco</td> <td>56</td>
<td>56</td> <td>2012/06/01</td>
<td>2012/06/01</td> <td>$115,000</td>
<td>$115,000</td> </tr>
</tr> <tr>
<tr> <td>Jennifer Acosta</td>
<td>Jennifer Acosta</td> <td>Junior Javascript Developer</td>
<td>Junior Javascript Developer</td> <td>Edinburgh</td>
<td>Edinburgh</td> <td>43</td>
<td>43</td> <td>2013/02/01</td>
<td>2013/02/01</td> <td>$75,650</td>
<td>$75,650</td> </tr>
</tr> <tr>
<tr> <td>Cara Stevens</td>
<td>Cara Stevens</td> <td>Sales Assistant</td>
<td>Sales Assistant</td> <td>New York</td>
<td>New York</td> <td>46</td>
<td>46</td> <td>2011/12/06</td>
<td>2011/12/06</td> <td>$145,600</td>
<td>$145,600</td> </tr>
</tr> <tr>
<tr> <td>Hermione Butler</td>
<td>Hermione Butler</td> <td>Regional Director</td>
<td>Regional Director</td> <td>London</td>
<td>London</td> <td>47</td>
<td>47</td> <td>2011/03/21</td>
<td>2011/03/21</td> <td>$356,250</td>
<td>$356,250</td> </tr>
</tr> <tr>
<tr> <td>Lael Greer</td>
<td>Lael Greer</td> <td>Systems Administrator</td>
<td>Systems Administrator</td> <td>London</td>
<td>London</td> <td>21</td>
<td>21</td> <td>2009/02/27</td>
<td>2009/02/27</td> <td>$103,500</td>
<td>$103,500</td> </tr>
</tr> <tr>
<tr> <td>Jonas Alexander</td>
<td>Jonas Alexander</td> <td>Developer</td>
<td>Developer</td> <td>San Francisco</td>
<td>San Francisco</td> <td>30</td>
<td>30</td> <td>2010/07/14</td>
<td>2010/07/14</td> <td>$86,500</td>
<td>$86,500</td> </tr>
</tr> <tr>
<tr> <td>Shad Decker</td>
<td>Shad Decker</td> <td>Regional Director</td>
<td>Regional Director</td> <td>Edinburgh</td>
<td>Edinburgh</td> <td>51</td>
<td>51</td> <td>2008/11/13</td>
<td>2008/11/13</td> <td>$183,000</td>
<td>$183,000</td> </tr>
</tr> <tr>
<tr> <td>Michael Bruce</td>
<td>Michael Bruce</td> <td>Javascript Developer</td>
<td>Javascript Developer</td> <td>Singapore</td>
<td>Singapore</td> <td>29</td>
<td>29</td> <td>2011/06/27</td>
<td>2011/06/27</td> <td>$183,000</td>
<td>$183,000</td> </tr>
</tr> <tr>
<tr> <td>Donna Snider</td>
<td>Donna Snider</td> <td>Customer Support</td>
<td>Customer Support</td> <td>New York</td>
<td>New York</td> <td>27</td>
<td>27</td> <td>2011/01/25</td>
<td>2011/01/25</td> <td>$112,000</td>
<td>$112,000</td> </tr>
</tr> </tbody>
</tbody> </table>
</table>
<ul class="tabs"> <ul class="tabs">
<li class="active">Javascript</li> <li class="active">Javascript</li>
<li>HTML</li> <li>HTML</li>
<li>CSS</li> <li>CSS</li>
<li>Ajax</li> <li>Ajax</li>
<li>Server-side script</li> <li>Server-side script</li>
</ul> </ul>
<div class="tabs">
<div class="js"> <div class="tabs">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() { <div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p>
<code class="multiline language-js">$(document).ready(function() {
$('#example').DataTable(); $('#example').DataTable();
} );</code> } );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul> <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<li> <ul><li><a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a></li><li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li></ul>
<a href="//code.jquery.com/jquery-1.12.3.js">//code.jquery.com/jquery-1.12.3.js</a> </div>
</li> <div class="table">
<li> <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
<a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a> </div>
</li> <div class="css">
</ul> <div>
</div> <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 additional CSS used is shown below:</p>
<div class="table"> <code class="multiline language-css"></code>
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p> </div>
</div>
<div class="css"> <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<div> <ul><li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li></ul>
<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 </div>
additional CSS used is shown below:</p><code class="multiline language-css"></code> <div class="ajax">
<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 loaded.</p>
</div>
<div class="php">
<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 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables documentation</a>.</p>
</div> </div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a>
</li>
</ul>
</div> </div>
<div class="ajax"> </section>
<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
loaded.</p>
</div> </div>
<div class="php">
<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 <section>
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables <div class="footer">
documentation</a>.</p> <div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group"><h3><a href="../basic_init/index.html
">Basic initialisation</a></h3><ul class="toc"><li><a href="../basic_init/zero_configuration.html
">Zero configuration</a></li><li><a href="../basic_init/filter_only.html
">Feature enable / disable</a></li><li><a href="../basic_init/table_sorting.html
">Default ordering (sorting)</a></li><li><a href="../basic_init/multi_col_sort.html
">Multi-column ordering</a></li><li><a href="../basic_init/multiple_tables.html
">Multiple tables</a></li><li><a href="../basic_init/hidden_columns.html
">Hidden columns</a></li><li><a href="../basic_init/complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="../basic_init/dom.html
">DOM positioning</a></li><li><a href="../basic_init/flexible_width.html
">Flexible table width</a></li><li><a href="../basic_init/state_save.html
">State saving</a></li><li><a href="../basic_init/alt_pagination.html
">Alternative pagination</a></li><li><a href="../basic_init/scroll_y.html
">Scroll - vertical</a></li><li><a href="../basic_init/scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="../basic_init/scroll_x.html
">Scroll - horizontal</a></li><li><a href="../basic_init/scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="../basic_init/comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="../basic_init/language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="./index.html
">Advanced initialisation</a></h3><ul class="toc active"><li><a href="./events_live.html
">DOM / jQuery events</a></li><li><a href="./dt_events.html
">DataTables events</a></li><li><a href="./column_render.html
">Column rendering</a></li><li><a href="./length_menu.html
">Page length options</a></li><li><a href="./dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="./complex_header.html
">Complex headers with column visibility</a></li><li><a href="./object_dom_read.html
">Read HTML to data objects</a></li><li class="active"><a href="./html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="./html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="./language_file.html
">Language file</a></li><li><a href="./defaults.html
">Setting defaults</a></li><li><a href="./row_callback.html
">Row created callback</a></li><li><a href="./row_grouping.html
">Row grouping</a></li><li><a href="./footer_callback.html
">Footer callback</a></li><li><a href="./dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="./sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="../styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="../styling/display.html
">Base style</a></li><li><a href="../styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="../styling/cell-border.html
">Base style - cell borders</a></li><li><a href="../styling/compact.html
">Base style - compact</a></li><li><a href="../styling/hover.html
">Base style - hover</a></li><li><a href="../styling/order-column.html
">Base style - order-column</a></li><li><a href="../styling/row-border.html
">Base style - row borders</a></li><li><a href="../styling/stripe.html
">Base style - stripe</a></li><li><a href="../styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="../styling/foundation.html
">Foundation</a></li><li><a href="../styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="../styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="../styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="../styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="../styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="../data_sources/index.html
">Data sources</a></h3><ul class="toc"><li><a href="../data_sources/dom.html
">HTML (DOM) sourced data</a></li><li><a href="../data_sources/ajax.html
">Ajax sourced data</a></li><li><a href="../data_sources/js_array.html
">Javascript sourced data</a></li><li><a href="../data_sources/server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="../api/index.html
">API</a></h3><ul class="toc"><li><a href="../api/add_row.html
">Add rows</a></li><li><a href="../api/multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="../api/multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="../api/highlight.html
">Highlighting rows and columns</a></li><li><a href="../api/row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="../api/select_row.html
">Row selection (multiple rows)</a></li><li><a href="../api/select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="../api/form.html
">Form inputs</a></li><li><a href="../api/counter_columns.html
">Index column</a></li><li><a href="../api/show_hide.html
">Show / hide columns dynamically</a></li><li><a href="../api/api_in_init.html
">Using API in callbacks</a></li><li><a href="../api/tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="../api/regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="../ajax/index.html
">Ajax</a></h3><ul class="toc"><li><a href="../ajax/simple.html
">Ajax data source (arrays)</a></li><li><a href="../ajax/objects.html
">Ajax data source (objects)</a></li><li><a href="../ajax/deep.html
">Nested object data (objects)</a></li><li><a href="../ajax/objects_subarrays.html
">Nested object data (arrays)</a></li><li><a href="../ajax/orthogonal-data.html
">Orthogonal data</a></li><li><a href="../ajax/null_data_source.html
">Generated content for a column</a></li><li><a href="../ajax/custom_data_property.html
">Custom data source property</a></li><li><a href="../ajax/custom_data_flat.html
">Flat array data source</a></li><li><a href="../ajax/defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="../server_side/index.html
">Server-side</a></h3><ul class="toc"><li><a href="../server_side/simple.html
">Server-side processing</a></li><li><a href="../server_side/custom_vars.html
">Custom HTTP variables</a></li><li><a href="../server_side/post.html
">POST data</a></li><li><a href="../server_side/ids.html
">Automatic addition of row ID attributes</a></li><li><a href="../server_side/object_data.html
">Object data source</a></li><li><a href="../server_side/row_details.html
">Row details</a></li><li><a href="../server_side/select_rows.html
">Row selection</a></li><li><a href="../server_side/jsonp.html
">JSONP data source for remote domains</a></li><li><a href="../server_side/defer_loading.html
">Deferred loading of data</a></li><li><a href="../server_side/pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="../plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="../plug-ins/api.html
">API plug-in methods</a></li><li><a href="../plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="../plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="../plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="../plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div> </div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="../basic_init/index.html">Basic initialisation</a></h3>
<ul class="toc">
<li>
<a href="../basic_init/zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="../basic_init/filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="../basic_init/table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="../basic_init/multi_col_sort.html">Multi-column ordering</a>
</li>
<li>
<a href="../basic_init/multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="../basic_init/hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="../basic_init/complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="../basic_init/dom.html">DOM positioning</a>
</li>
<li>
<a href="../basic_init/flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="../basic_init/state_save.html">State saving</a>
</li>
<li>
<a href="../basic_init/alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="../basic_init/scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="../basic_init/scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="../basic_init/scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="../basic_init/scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="../basic_init/comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="../basic_init/language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./index.html">Advanced initialisation</a></h3>
<ul class="toc active">
<li>
<a href="./events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="./dt_events.html">DataTables events</a>
</li>
<li>
<a href="./column_render.html">Column rendering</a>
</li>
<li>
<a href="./length_menu.html">Page length options</a>
</li>
<li>
<a href="./dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="./complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="./object_dom_read.html">Read HTML to data objects</a>
</li>
<li class="active">
<a href="./html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="./html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="./language_file.html">Language file</a>
</li>
<li>
<a href="./defaults.html">Setting defaults</a>
</li>
<li>
<a href="./row_callback.html">Row created callback</a>
</li>
<li>
<a href="./row_grouping.html">Row grouping</a>
</li>
<li>
<a href="./footer_callback.html">Footer callback</a>
</li>
<li>
<a href="./dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="./sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/display.html">Base style</a>
</li>
<li>
<a href="../styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="../styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="../styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="../styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="../styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="../styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="../styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="../styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="../styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../data_sources/index.html">Data sources</a></h3>
<ul class="toc">
<li>
<a href="../data_sources/dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="../data_sources/ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="../data_sources/js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="../data_sources/server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="../api/add_row.html">Add rows</a>
</li>
<li>
<a href="../api/multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="../api/multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="../api/highlight.html">Highlighting rows and columns</a>
</li>
<li>
<a href="../api/row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="../api/select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="../api/select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="../api/form.html">Form inputs</a>
</li>
<li>
<a href="../api/counter_columns.html">Index column</a>
</li>
<li>
<a href="../api/show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="../api/api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="../api/tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="../api/regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../ajax/index.html">Ajax</a></h3>
<ul class="toc">
<li>
<a href="../ajax/simple.html">Ajax data source (arrays)</a>
</li>
<li>
<a href="../ajax/objects.html">Ajax data source (objects)</a>
</li>
<li>
<a href="../ajax/deep.html">Nested object data (objects)</a>
</li>
<li>
<a href="../ajax/objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="../ajax/orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="../ajax/null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="../ajax/custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="../ajax/custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="../ajax/defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../server_side/index.html">Server-side</a></h3>
<ul class="toc">
<li>
<a href="../server_side/simple.html">Server-side processing</a>
</li>
<li>
<a href="../server_side/custom_vars.html">Custom HTTP variables</a>
</li>
<li>
<a href="../server_side/post.html">POST data</a>
</li>
<li>
<a href="../server_side/ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="../server_side/object_data.html">Object data source</a>
</li>
<li>
<a href="../server_side/row_details.html">Row details</a>
</li>
<li>
<a href="../server_side/select_rows.html">Row selection</a>
</li>
<li>
<a href="../server_side/jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="../server_side/defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="../server_side/pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="../plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="../plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

View File

@ -1,100 +1,65 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <title>DataTables examples - Advanced initialisation</title>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"> </head>
</script> <body class="dt-example">
<script type="text/javascript" language="javascript" src="../resources/demo.js"> <div class="container">
</script> <section>
<title>DataTables examples - Advanced initialisation</title> <h1>DataTables example <span>Advanced initialisation</span></h1>
</head> <div class="info">
<body class="dt-example"> <p>The configuration options offered by DataTables extend much further than the options shown in the basic initialisation of this documentation. Through combinations of the options available and the use of callbacks, DataTables is completely customisable and will fit into exactly what you need for your table display.</p>
<div class="container">
<p>This section shows some more advanced initialisation options. Keep in mind also that each example can be combined with the other examples to get what you want!</p>
</div>
</section>
</div>
<section> <section>
<h1>DataTables example <span>Advanced initialisation</span></h1> <div class="footer">
<div class="info"> <div class="gradient"></div>
<p>The configuration options offered by DataTables extend much further than the options shown in the basic initialisation of this documentation. Through <div class="liner">
combinations of the options available and the use of callbacks, DataTables is completely customisable and will fit into exactly what you need for your table <div class="toc">
display.</p> <div class="toc-group"><h3><a href="./index.html
<p>This section shows some more advanced initialisation options. Keep in mind also that each example can be combined with the other examples to get what you ">Advanced initialisation</a></h3><ul class="toc"><li><a href="./events_live.html
want!</p> ">DOM / jQuery events</a></li><li><a href="./dt_events.html
</div> ">DataTables events</a></li><li><a href="./column_render.html
</section> ">Column rendering</a></li><li><a href="./length_menu.html
</div> ">Page length options</a></li><li><a href="./dom_multiple_elements.html
<section> ">Multiple table control elements</a></li><li><a href="./complex_header.html
<div class="footer"> ">Complex headers with column visibility</a></li><li><a href="./object_dom_read.html
<div class="gradient"></div> ">Read HTML to data objects</a></li><li><a href="./html5-data-options.html
<div class="liner"> ">HTML5 data-* attributes - table options</a></li><li><a href="./html5-data-attributes.html
<div class="toc"> ">HTML5 data-* attributes - cell data</a></li><li><a href="./language_file.html
<div class="toc-group"> ">Language file</a></li><li><a href="./defaults.html
<h3><a href="./index.html">Advanced initialisation</a></h3> ">Setting defaults</a></li><li><a href="./row_callback.html
<ul class="toc"> ">Row created callback</a></li><li><a href="./row_grouping.html
<li> ">Row grouping</a></li><li><a href="./footer_callback.html
<a href="./events_live.html">DOM / jQuery events</a> ">Footer callback</a></li><li><a href="./dom_toolbar.html
</li> ">Custom toolbar elements</a></li><li><a href="./sort_direction_control.html
<li> ">Order direction sequence control</a></li></ul></div>
<a href="./dt_events.html">DataTables events</a> </div>
</li>
<li> <div class="epilogue">
<a href="./column_render.html">Column rendering</a> <p>
</li> Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
<li> Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
<a href="./length_menu.html">Page length options</a> </p>
</li>
<li> <p class="copyright">
<a href="./dom_multiple_elements.html">Multiple table control elements</a> DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
</li> DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
<li> </p>
<a href="./complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="./object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="./html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="./html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="./language_file.html">Language file</a>
</li>
<li>
<a href="./defaults.html">Setting defaults</a>
</li>
<li>
<a href="./row_callback.html">Row created callback</a>
</li>
<li>
<a href="./row_grouping.html">Row grouping</a>
</li>
<li>
<a href="./footer_callback.html">Footer callback</a>
</li>
<li>
<a href="./dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="./sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div> </div>
</div> </div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div> </div>
</div> </section>
</section> </body>
</body>
</html> </html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,26 +1,19 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<title>DataTables example - Flat array data source</title>
<link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"> <title>DataTables example - Flat array data source</title>
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"><link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<style type="text/css" class="init"> <style type="text/css" class="init">
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <script type="text/javascript" language="javascript" class="init">
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() { $(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
"ajax": { "ajax": {
@ -38,60 +31,42 @@ $(document).ready(function() {
} ); } );
} ); } );
</script> </script>
</head> </head>
<body class="dt-example"> <body class="dt-example ">
<div class="container"> <div class="container">
<section> <section>
<h1>DataTables example <span>Flat array data source</span></h1> <h1>DataTables example <span>Flat array data source</span></h1>
<div class="info"> <div class="info">
<p>When loading data from an Ajax source, by default, DataTables will look for the data to use in the <code>data</code> parameter of a returned object (e.g. <p>When loading data from an Ajax source, by default, DataTables will look for the data to use in the <code>data</code> parameter of a returned object (e.g. <code>{ "data": [...] }</code>). This can easily be change by using the <code>dataSrc</code> option of the <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> initiation option.</p>
<code>{ "data": [...] }</code>). This can easily be change by using the <code>dataSrc</code> option of the <a href=
"//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> initiation option.</p> <p>The <a href="//datatables.net/reference/option/ajax.dataSrc"><code class="option" title="DataTables initialisation option">ajax.dataSrc</code></a> has a number of ways in which it can be used:</p>
<p>The <a href="//datatables.net/reference/option/ajax.dataSrc"><code class="option" title="DataTables initialisation option">ajax.dataSrc</code></a> has a number
of ways in which it can be used:</p> <ul class="markdown">
<ul class="markdown"> <li>As a string (e.g. <code>dataSrc: 'myData'</code>) - obtain data from a different property in the source object.</li>
<li>As a string (e.g. <code>dataSrc: 'myData'</code>) - obtain data from a different property in the source object.</li> <li>As an empty string (e.g. <code>dataSrc: ''</code>) - the data source is not an object but an array.</li>
<li>As an empty string (e.g. <code>dataSrc: ''</code>) - the data source is not an object but an array.</li> <li>As a function (e.g. <code>dataSrc: function(json) {}</code>) - a function can be used to transform the data from one source format to another (for example you could convert from XML to a Javascript object). The value returned from the function is used as the data for the table.</li>
<li>As a function (e.g. <code>dataSrc: function(json) {}</code>) - a function can be used to transform the data from one source format to another (for example </ul>
you could convert from XML to a Javascript object). The value returned from the function is used as the data for the table.</li>
<p>The example below shows <a href="//datatables.net/reference/option/ajax.dataSrc"><code class="option" title="DataTables initialisation option">ajax.dataSrc</code></a> being used as an empty string. This tells DataTables that the JSON loaded is a plain array, not an object with an array inside it as is the default.</p>
</div>
<table id="example" class="display" cellspacing="0" width="100%"><thead><tr><th>Name</th><th>Position</th><th>Office</th><th>Extn.</th><th>Start date</th><th>Salary</th></tr></thead><tfoot><tr><th>Name</th><th>Position</th><th>Office</th><th>Extn.</th><th>Start date</th><th>Salary</th></tr></tfoot></table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul> </ul>
<p>The example below shows <a href="//datatables.net/reference/option/ajax.dataSrc"><code class="option" title=
"DataTables initialisation option">ajax.dataSrc</code></a> being used as an empty string. This tells DataTables that the JSON loaded is a plain array, not an <div class="tabs">
object with an array inside it as is the default.</p> <div class="js">
</div> <p>The Javascript shown below is used to initialise the table shown in this example:</p>
<table id="example" class="display" cellspacing="0" width="100%"> <code class="multiline language-js">$(document).ready(function() {
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Extn.</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Extn.</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
&quot;ajax&quot;: { &quot;ajax&quot;: {
&quot;url&quot;: &quot;data/objects_root_array.txt&quot;, &quot;url&quot;: &quot;data/objects_root_array.txt&quot;,
@ -107,366 +82,153 @@ $(document).ready(function() {
] ]
} ); } );
} );</code> } );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul> <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<li> <ul><li><a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a></li><li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li></ul>
<a href="//code.jquery.com/jquery-1.12.3.js">//code.jquery.com/jquery-1.12.3.js</a> </div>
</li> <div class="table">
<li> <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
<a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a> </div>
</li> <div class="css">
</ul> <div>
</div> <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 additional CSS used is shown below:</p>
<div class="table"> <code class="multiline language-css"></code>
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p> </div>
</div>
<div class="css"> <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<div> <ul><li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li></ul>
<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 </div>
additional CSS used is shown below:</p><code class="multiline language-css"></code> <div class="ajax">
<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 loaded.</p>
</div>
<div class="php">
<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 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables documentation</a>.</p>
</div> </div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a>
</li>
</ul>
</div> </div>
<div class="ajax"> </section>
<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
loaded.</p>
</div> </div>
<div class="php">
<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 <section>
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables <div class="footer">
documentation</a>.</p> <div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group"><h3><a href="../basic_init/index.html
">Basic initialisation</a></h3><ul class="toc"><li><a href="../basic_init/zero_configuration.html
">Zero configuration</a></li><li><a href="../basic_init/filter_only.html
">Feature enable / disable</a></li><li><a href="../basic_init/table_sorting.html
">Default ordering (sorting)</a></li><li><a href="../basic_init/multi_col_sort.html
">Multi-column ordering</a></li><li><a href="../basic_init/multiple_tables.html
">Multiple tables</a></li><li><a href="../basic_init/hidden_columns.html
">Hidden columns</a></li><li><a href="../basic_init/complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="../basic_init/dom.html
">DOM positioning</a></li><li><a href="../basic_init/flexible_width.html
">Flexible table width</a></li><li><a href="../basic_init/state_save.html
">State saving</a></li><li><a href="../basic_init/alt_pagination.html
">Alternative pagination</a></li><li><a href="../basic_init/scroll_y.html
">Scroll - vertical</a></li><li><a href="../basic_init/scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="../basic_init/scroll_x.html
">Scroll - horizontal</a></li><li><a href="../basic_init/scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="../basic_init/comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="../basic_init/language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="../advanced_init/index.html
">Advanced initialisation</a></h3><ul class="toc"><li><a href="../advanced_init/events_live.html
">DOM / jQuery events</a></li><li><a href="../advanced_init/dt_events.html
">DataTables events</a></li><li><a href="../advanced_init/column_render.html
">Column rendering</a></li><li><a href="../advanced_init/length_menu.html
">Page length options</a></li><li><a href="../advanced_init/dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="../advanced_init/complex_header.html
">Complex headers with column visibility</a></li><li><a href="../advanced_init/object_dom_read.html
">Read HTML to data objects</a></li><li><a href="../advanced_init/html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="../advanced_init/html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="../advanced_init/language_file.html
">Language file</a></li><li><a href="../advanced_init/defaults.html
">Setting defaults</a></li><li><a href="../advanced_init/row_callback.html
">Row created callback</a></li><li><a href="../advanced_init/row_grouping.html
">Row grouping</a></li><li><a href="../advanced_init/footer_callback.html
">Footer callback</a></li><li><a href="../advanced_init/dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="../advanced_init/sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="../styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="../styling/display.html
">Base style</a></li><li><a href="../styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="../styling/cell-border.html
">Base style - cell borders</a></li><li><a href="../styling/compact.html
">Base style - compact</a></li><li><a href="../styling/hover.html
">Base style - hover</a></li><li><a href="../styling/order-column.html
">Base style - order-column</a></li><li><a href="../styling/row-border.html
">Base style - row borders</a></li><li><a href="../styling/stripe.html
">Base style - stripe</a></li><li><a href="../styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="../styling/foundation.html
">Foundation</a></li><li><a href="../styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="../styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="../styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="../styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="../styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="../data_sources/index.html
">Data sources</a></h3><ul class="toc"><li><a href="../data_sources/dom.html
">HTML (DOM) sourced data</a></li><li><a href="../data_sources/ajax.html
">Ajax sourced data</a></li><li><a href="../data_sources/js_array.html
">Javascript sourced data</a></li><li><a href="../data_sources/server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="../api/index.html
">API</a></h3><ul class="toc"><li><a href="../api/add_row.html
">Add rows</a></li><li><a href="../api/multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="../api/multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="../api/highlight.html
">Highlighting rows and columns</a></li><li><a href="../api/row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="../api/select_row.html
">Row selection (multiple rows)</a></li><li><a href="../api/select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="../api/form.html
">Form inputs</a></li><li><a href="../api/counter_columns.html
">Index column</a></li><li><a href="../api/show_hide.html
">Show / hide columns dynamically</a></li><li><a href="../api/api_in_init.html
">Using API in callbacks</a></li><li><a href="../api/tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="../api/regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="./index.html
">Ajax</a></h3><ul class="toc active"><li><a href="./simple.html
">Ajax data source (arrays)</a></li><li><a href="./objects.html
">Ajax data source (objects)</a></li><li><a href="./deep.html
">Nested object data (objects)</a></li><li><a href="./objects_subarrays.html
">Nested object data (arrays)</a></li><li><a href="./orthogonal-data.html
">Orthogonal data</a></li><li><a href="./null_data_source.html
">Generated content for a column</a></li><li><a href="./custom_data_property.html
">Custom data source property</a></li><li class="active"><a href="./custom_data_flat.html
">Flat array data source</a></li><li><a href="./defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="../server_side/index.html
">Server-side</a></h3><ul class="toc"><li><a href="../server_side/simple.html
">Server-side processing</a></li><li><a href="../server_side/custom_vars.html
">Custom HTTP variables</a></li><li><a href="../server_side/post.html
">POST data</a></li><li><a href="../server_side/ids.html
">Automatic addition of row ID attributes</a></li><li><a href="../server_side/object_data.html
">Object data source</a></li><li><a href="../server_side/row_details.html
">Row details</a></li><li><a href="../server_side/select_rows.html
">Row selection</a></li><li><a href="../server_side/jsonp.html
">JSONP data source for remote domains</a></li><li><a href="../server_side/defer_loading.html
">Deferred loading of data</a></li><li><a href="../server_side/pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="../plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="../plug-ins/api.html
">API plug-in methods</a></li><li><a href="../plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="../plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="../plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="../plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div> </div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="../basic_init/index.html">Basic initialisation</a></h3>
<ul class="toc">
<li>
<a href="../basic_init/zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="../basic_init/filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="../basic_init/table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="../basic_init/multi_col_sort.html">Multi-column ordering</a>
</li>
<li>
<a href="../basic_init/multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="../basic_init/hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="../basic_init/complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="../basic_init/dom.html">DOM positioning</a>
</li>
<li>
<a href="../basic_init/flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="../basic_init/state_save.html">State saving</a>
</li>
<li>
<a href="../basic_init/alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="../basic_init/scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="../basic_init/scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="../basic_init/scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="../basic_init/scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="../basic_init/comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="../basic_init/language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../advanced_init/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="../advanced_init/events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="../advanced_init/dt_events.html">DataTables events</a>
</li>
<li>
<a href="../advanced_init/column_render.html">Column rendering</a>
</li>
<li>
<a href="../advanced_init/length_menu.html">Page length options</a>
</li>
<li>
<a href="../advanced_init/dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="../advanced_init/complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="../advanced_init/object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="../advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="../advanced_init/language_file.html">Language file</a>
</li>
<li>
<a href="../advanced_init/defaults.html">Setting defaults</a>
</li>
<li>
<a href="../advanced_init/row_callback.html">Row created callback</a>
</li>
<li>
<a href="../advanced_init/row_grouping.html">Row grouping</a>
</li>
<li>
<a href="../advanced_init/footer_callback.html">Footer callback</a>
</li>
<li>
<a href="../advanced_init/dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="../advanced_init/sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/display.html">Base style</a>
</li>
<li>
<a href="../styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="../styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="../styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="../styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="../styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="../styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="../styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="../styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="../styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../data_sources/index.html">Data sources</a></h3>
<ul class="toc">
<li>
<a href="../data_sources/dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="../data_sources/ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="../data_sources/js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="../data_sources/server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="../api/add_row.html">Add rows</a>
</li>
<li>
<a href="../api/multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="../api/multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="../api/highlight.html">Highlighting rows and columns</a>
</li>
<li>
<a href="../api/row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="../api/select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="../api/select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="../api/form.html">Form inputs</a>
</li>
<li>
<a href="../api/counter_columns.html">Index column</a>
</li>
<li>
<a href="../api/show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="../api/api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="../api/tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="../api/regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./index.html">Ajax</a></h3>
<ul class="toc active">
<li>
<a href="./simple.html">Ajax data source (arrays)</a>
</li>
<li>
<a href="./objects.html">Ajax data source (objects)</a>
</li>
<li>
<a href="./deep.html">Nested object data (objects)</a>
</li>
<li>
<a href="./objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="./orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="./null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="./custom_data_property.html">Custom data source property</a>
</li>
<li class="active">
<a href="./custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="./defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../server_side/index.html">Server-side</a></h3>
<ul class="toc">
<li>
<a href="../server_side/simple.html">Server-side processing</a>
</li>
<li>
<a href="../server_side/custom_vars.html">Custom HTTP variables</a>
</li>
<li>
<a href="../server_side/post.html">POST data</a>
</li>
<li>
<a href="../server_side/ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="../server_side/object_data.html">Object data source</a>
</li>
<li>
<a href="../server_side/row_details.html">Row details</a>
</li>
<li>
<a href="../server_side/select_rows.html">Row selection</a>
</li>
<li>
<a href="../server_side/jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="../server_side/defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="../server_side/pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="../plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="../plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

View File

@ -1,26 +1,19 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<title>DataTables example - Custom data source property</title>
<link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"> <title>DataTables example - Custom data source property</title>
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"><link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<style type="text/css" class="init"> <style type="text/css" class="init">
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <script type="text/javascript" language="javascript" class="init">
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() { $(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
"ajax": { "ajax": {
@ -30,61 +23,44 @@ $(document).ready(function() {
} ); } );
} ); } );
</script> </script>
</head> </head>
<body class="dt-example"> <body class="dt-example ">
<div class="container"> <div class="container">
<section> <section>
<h1>DataTables example <span>Custom data source property</span></h1> <h1>DataTables example <span>Custom data source property</span></h1>
<div class="info"> <div class="info">
<p>When loading data from an Ajax source, by default, DataTables will look for the data to use in the <code>data</code> parameter of a returned object (e.g. <p>When loading data from an Ajax source, by default, DataTables will look for the data to use in the <code>data</code> parameter of a returned object (e.g. <code>{ "data": [...] }</code>). This can easily be change by using the <code>dataSrc</code> option of the <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> initiation option.</p>
<code>{ "data": [...] }</code>). This can easily be change by using the <code>dataSrc</code> option of the <a href=
"//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> initiation option.</p> <p>The <a href="//datatables.net/reference/option/ajax.dataSrc"><code class="option" title="DataTables initialisation option">ajax.dataSrc</code></a> has a number of ways in which it can be used:</p>
<p>The <a href="//datatables.net/reference/option/ajax.dataSrc"><code class="option" title="DataTables initialisation option">ajax.dataSrc</code></a> has a number
of ways in which it can be used:</p> <ul class="markdown">
<ul class="markdown"> <li>As a string (e.g. <code>dataSrc: 'myData'</code>) - obtain data from a different property in the source object.</li>
<li>As a string (e.g. <code>dataSrc: 'myData'</code>) - obtain data from a different property in the source object.</li> <li>As an empty string (e.g. <code>dataSrc: ''</code>) - the data source is not an object but an array.</li>
<li>As an empty string (e.g. <code>dataSrc: ''</code>) - the data source is not an object but an array.</li> <li>As a function (e.g. <code>dataSrc: function(json) {}</code>) - a function can be used to transform the data from one source format to another (for example you could convert from XML to a Javascript object). The value returned from the function is used as the data for the table.</li>
<li>As a function (e.g. <code>dataSrc: function(json) {}</code>) - a function can be used to transform the data from one source format to another (for example </ul>
you could convert from XML to a Javascript object). The value returned from the function is used as the data for the table.</li>
<p>The example below shows <a href="//datatables.net/reference/option/ajax.dataSrc"><code class="option" title="DataTables initialisation option">ajax.dataSrc</code></a> being used as a string to get the data from a different source property, in this case <code class="string" title="String">demo</code> but it could be any value, included a nested property by using standard dotted Javascript object notation.</p>
<p>For more details on loading a DataTable with Ajax data, please refer to the <a href="https://datatables.net/manual/ajax">Ajax section of the manual</a>.</p>
</div>
<table id="example" class="display" cellspacing="0" width="100%"><thead><tr><th>Name</th><th>Position</th><th>Office</th><th>Extn.</th><th>Start date</th><th>Salary</th></tr></thead><tfoot><tr><th>Name</th><th>Position</th><th>Office</th><th>Extn.</th><th>Start date</th><th>Salary</th></tr></tfoot></table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul> </ul>
<p>The example below shows <a href="//datatables.net/reference/option/ajax.dataSrc"><code class="option" title=
"DataTables initialisation option">ajax.dataSrc</code></a> being used as a string to get the data from a different source property, in this case <code class= <div class="tabs">
"string" title="String">demo</code> but it could be any value, included a nested property by using standard dotted Javascript object notation.</p> <div class="js">
<p>For more details on loading a DataTable with Ajax data, please refer to the <a href="https://datatables.net/manual/ajax">Ajax section of the manual</a>.</p> <p>The Javascript shown below is used to initialise the table shown in this example:</p>
</div> <code class="multiline language-js">$(document).ready(function() {
<table id="example" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Extn.</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Extn.</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
&quot;ajax&quot;: { &quot;ajax&quot;: {
&quot;url&quot;: &quot;data/arrays_custom_prop.txt&quot;, &quot;url&quot;: &quot;data/arrays_custom_prop.txt&quot;,
@ -92,366 +68,153 @@ $(document).ready(function() {
} }
} ); } );
} );</code> } );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul> <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<li> <ul><li><a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a></li><li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li></ul>
<a href="//code.jquery.com/jquery-1.12.3.js">//code.jquery.com/jquery-1.12.3.js</a> </div>
</li> <div class="table">
<li> <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
<a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a> </div>
</li> <div class="css">
</ul> <div>
</div> <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 additional CSS used is shown below:</p>
<div class="table"> <code class="multiline language-css"></code>
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p> </div>
</div>
<div class="css"> <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<div> <ul><li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li></ul>
<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 </div>
additional CSS used is shown below:</p><code class="multiline language-css"></code> <div class="ajax">
<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 loaded.</p>
</div>
<div class="php">
<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 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables documentation</a>.</p>
</div> </div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a>
</li>
</ul>
</div> </div>
<div class="ajax"> </section>
<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
loaded.</p>
</div> </div>
<div class="php">
<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 <section>
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables <div class="footer">
documentation</a>.</p> <div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group"><h3><a href="../basic_init/index.html
">Basic initialisation</a></h3><ul class="toc"><li><a href="../basic_init/zero_configuration.html
">Zero configuration</a></li><li><a href="../basic_init/filter_only.html
">Feature enable / disable</a></li><li><a href="../basic_init/table_sorting.html
">Default ordering (sorting)</a></li><li><a href="../basic_init/multi_col_sort.html
">Multi-column ordering</a></li><li><a href="../basic_init/multiple_tables.html
">Multiple tables</a></li><li><a href="../basic_init/hidden_columns.html
">Hidden columns</a></li><li><a href="../basic_init/complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="../basic_init/dom.html
">DOM positioning</a></li><li><a href="../basic_init/flexible_width.html
">Flexible table width</a></li><li><a href="../basic_init/state_save.html
">State saving</a></li><li><a href="../basic_init/alt_pagination.html
">Alternative pagination</a></li><li><a href="../basic_init/scroll_y.html
">Scroll - vertical</a></li><li><a href="../basic_init/scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="../basic_init/scroll_x.html
">Scroll - horizontal</a></li><li><a href="../basic_init/scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="../basic_init/comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="../basic_init/language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="../advanced_init/index.html
">Advanced initialisation</a></h3><ul class="toc"><li><a href="../advanced_init/events_live.html
">DOM / jQuery events</a></li><li><a href="../advanced_init/dt_events.html
">DataTables events</a></li><li><a href="../advanced_init/column_render.html
">Column rendering</a></li><li><a href="../advanced_init/length_menu.html
">Page length options</a></li><li><a href="../advanced_init/dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="../advanced_init/complex_header.html
">Complex headers with column visibility</a></li><li><a href="../advanced_init/object_dom_read.html
">Read HTML to data objects</a></li><li><a href="../advanced_init/html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="../advanced_init/html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="../advanced_init/language_file.html
">Language file</a></li><li><a href="../advanced_init/defaults.html
">Setting defaults</a></li><li><a href="../advanced_init/row_callback.html
">Row created callback</a></li><li><a href="../advanced_init/row_grouping.html
">Row grouping</a></li><li><a href="../advanced_init/footer_callback.html
">Footer callback</a></li><li><a href="../advanced_init/dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="../advanced_init/sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="../styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="../styling/display.html
">Base style</a></li><li><a href="../styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="../styling/cell-border.html
">Base style - cell borders</a></li><li><a href="../styling/compact.html
">Base style - compact</a></li><li><a href="../styling/hover.html
">Base style - hover</a></li><li><a href="../styling/order-column.html
">Base style - order-column</a></li><li><a href="../styling/row-border.html
">Base style - row borders</a></li><li><a href="../styling/stripe.html
">Base style - stripe</a></li><li><a href="../styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="../styling/foundation.html
">Foundation</a></li><li><a href="../styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="../styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="../styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="../styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="../styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="../data_sources/index.html
">Data sources</a></h3><ul class="toc"><li><a href="../data_sources/dom.html
">HTML (DOM) sourced data</a></li><li><a href="../data_sources/ajax.html
">Ajax sourced data</a></li><li><a href="../data_sources/js_array.html
">Javascript sourced data</a></li><li><a href="../data_sources/server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="../api/index.html
">API</a></h3><ul class="toc"><li><a href="../api/add_row.html
">Add rows</a></li><li><a href="../api/multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="../api/multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="../api/highlight.html
">Highlighting rows and columns</a></li><li><a href="../api/row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="../api/select_row.html
">Row selection (multiple rows)</a></li><li><a href="../api/select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="../api/form.html
">Form inputs</a></li><li><a href="../api/counter_columns.html
">Index column</a></li><li><a href="../api/show_hide.html
">Show / hide columns dynamically</a></li><li><a href="../api/api_in_init.html
">Using API in callbacks</a></li><li><a href="../api/tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="../api/regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="./index.html
">Ajax</a></h3><ul class="toc active"><li><a href="./simple.html
">Ajax data source (arrays)</a></li><li><a href="./objects.html
">Ajax data source (objects)</a></li><li><a href="./deep.html
">Nested object data (objects)</a></li><li><a href="./objects_subarrays.html
">Nested object data (arrays)</a></li><li><a href="./orthogonal-data.html
">Orthogonal data</a></li><li><a href="./null_data_source.html
">Generated content for a column</a></li><li class="active"><a href="./custom_data_property.html
">Custom data source property</a></li><li><a href="./custom_data_flat.html
">Flat array data source</a></li><li><a href="./defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="../server_side/index.html
">Server-side</a></h3><ul class="toc"><li><a href="../server_side/simple.html
">Server-side processing</a></li><li><a href="../server_side/custom_vars.html
">Custom HTTP variables</a></li><li><a href="../server_side/post.html
">POST data</a></li><li><a href="../server_side/ids.html
">Automatic addition of row ID attributes</a></li><li><a href="../server_side/object_data.html
">Object data source</a></li><li><a href="../server_side/row_details.html
">Row details</a></li><li><a href="../server_side/select_rows.html
">Row selection</a></li><li><a href="../server_side/jsonp.html
">JSONP data source for remote domains</a></li><li><a href="../server_side/defer_loading.html
">Deferred loading of data</a></li><li><a href="../server_side/pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="../plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="../plug-ins/api.html
">API plug-in methods</a></li><li><a href="../plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="../plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="../plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="../plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div> </div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="../basic_init/index.html">Basic initialisation</a></h3>
<ul class="toc">
<li>
<a href="../basic_init/zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="../basic_init/filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="../basic_init/table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="../basic_init/multi_col_sort.html">Multi-column ordering</a>
</li>
<li>
<a href="../basic_init/multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="../basic_init/hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="../basic_init/complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="../basic_init/dom.html">DOM positioning</a>
</li>
<li>
<a href="../basic_init/flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="../basic_init/state_save.html">State saving</a>
</li>
<li>
<a href="../basic_init/alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="../basic_init/scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="../basic_init/scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="../basic_init/scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="../basic_init/scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="../basic_init/comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="../basic_init/language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../advanced_init/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="../advanced_init/events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="../advanced_init/dt_events.html">DataTables events</a>
</li>
<li>
<a href="../advanced_init/column_render.html">Column rendering</a>
</li>
<li>
<a href="../advanced_init/length_menu.html">Page length options</a>
</li>
<li>
<a href="../advanced_init/dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="../advanced_init/complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="../advanced_init/object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="../advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="../advanced_init/language_file.html">Language file</a>
</li>
<li>
<a href="../advanced_init/defaults.html">Setting defaults</a>
</li>
<li>
<a href="../advanced_init/row_callback.html">Row created callback</a>
</li>
<li>
<a href="../advanced_init/row_grouping.html">Row grouping</a>
</li>
<li>
<a href="../advanced_init/footer_callback.html">Footer callback</a>
</li>
<li>
<a href="../advanced_init/dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="../advanced_init/sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/display.html">Base style</a>
</li>
<li>
<a href="../styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="../styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="../styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="../styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="../styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="../styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="../styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="../styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="../styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../data_sources/index.html">Data sources</a></h3>
<ul class="toc">
<li>
<a href="../data_sources/dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="../data_sources/ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="../data_sources/js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="../data_sources/server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="../api/add_row.html">Add rows</a>
</li>
<li>
<a href="../api/multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="../api/multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="../api/highlight.html">Highlighting rows and columns</a>
</li>
<li>
<a href="../api/row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="../api/select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="../api/select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="../api/form.html">Form inputs</a>
</li>
<li>
<a href="../api/counter_columns.html">Index column</a>
</li>
<li>
<a href="../api/show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="../api/api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="../api/tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="../api/regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./index.html">Ajax</a></h3>
<ul class="toc active">
<li>
<a href="./simple.html">Ajax data source (arrays)</a>
</li>
<li>
<a href="./objects.html">Ajax data source (objects)</a>
</li>
<li>
<a href="./deep.html">Nested object data (objects)</a>
</li>
<li>
<a href="./objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="./orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="./null_data_source.html">Generated content for a column</a>
</li>
<li class="active">
<a href="./custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="./custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="./defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../server_side/index.html">Server-side</a></h3>
<ul class="toc">
<li>
<a href="../server_side/simple.html">Server-side processing</a>
</li>
<li>
<a href="../server_side/custom_vars.html">Custom HTTP variables</a>
</li>
<li>
<a href="../server_side/post.html">POST data</a>
</li>
<li>
<a href="../server_side/ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="../server_side/object_data.html">Object data source</a>
</li>
<li>
<a href="../server_side/row_details.html">Row details</a>
</li>
<li>
<a href="../server_side/select_rows.html">Row selection</a>
</li>
<li>
<a href="../server_side/jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="../server_side/defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="../server_side/pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="../plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="../plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

View File

@ -6,7 +6,7 @@
"salary": "$320,800", "salary": "$320,800",
"start_date": { "start_date": {
"display": "Mon 25th Apr 11", "display": "Mon 25th Apr 11",
"timestamp": "1303686000" "timestamp": "1303689600"
}, },
"office": "Edinburgh", "office": "Edinburgh",
"extn": "5421" "extn": "5421"
@ -17,7 +17,7 @@
"salary": "$170,750", "salary": "$170,750",
"start_date": { "start_date": {
"display": "Mon 25th Jul 11", "display": "Mon 25th Jul 11",
"timestamp": "1311548400" "timestamp": "1311552000"
}, },
"office": "Tokyo", "office": "Tokyo",
"extn": "8422" "extn": "8422"
@ -39,7 +39,7 @@
"salary": "$433,060", "salary": "$433,060",
"start_date": { "start_date": {
"display": "Thu 29th Mar 12", "display": "Thu 29th Mar 12",
"timestamp": "1332975600" "timestamp": "1332979200"
}, },
"office": "Edinburgh", "office": "Edinburgh",
"extn": "6224" "extn": "6224"
@ -72,7 +72,7 @@
"salary": "$137,500", "salary": "$137,500",
"start_date": { "start_date": {
"display": "Mon 6th Aug 12", "display": "Mon 6th Aug 12",
"timestamp": "1344207600" "timestamp": "1344211200"
}, },
"office": "San Francisco", "office": "San Francisco",
"extn": "9608" "extn": "9608"
@ -83,7 +83,7 @@
"salary": "$327,900", "salary": "$327,900",
"start_date": { "start_date": {
"display": "Thu 14th Oct 10", "display": "Thu 14th Oct 10",
"timestamp": "1287010800" "timestamp": "1287014400"
}, },
"office": "Tokyo", "office": "Tokyo",
"extn": "6200" "extn": "6200"
@ -94,7 +94,7 @@
"salary": "$205,500", "salary": "$205,500",
"start_date": { "start_date": {
"display": "Tue 15th Sep 09", "display": "Tue 15th Sep 09",
"timestamp": "1252969200" "timestamp": "1252972800"
}, },
"office": "San Francisco", "office": "San Francisco",
"extn": "2360" "extn": "2360"
@ -138,7 +138,7 @@
"salary": "$470,600", "salary": "$470,600",
"start_date": { "start_date": {
"display": "Thu 16th Oct 08", "display": "Thu 16th Oct 08",
"timestamp": "1224111600" "timestamp": "1224115200"
}, },
"office": "San Francisco", "office": "San Francisco",
"extn": "6741" "extn": "6741"
@ -182,7 +182,7 @@
"salary": "$725,000", "salary": "$725,000",
"start_date": { "start_date": {
"display": "Wed 9th Jun 10", "display": "Wed 9th Jun 10",
"timestamp": "1276038000" "timestamp": "1276041600"
}, },
"office": "New York", "office": "New York",
"extn": "3059" "extn": "3059"
@ -193,7 +193,7 @@
"salary": "$237,500", "salary": "$237,500",
"start_date": { "start_date": {
"display": "Fri 10th Apr 09", "display": "Fri 10th Apr 09",
"timestamp": "1239318000" "timestamp": "1239321600"
}, },
"office": "New York", "office": "New York",
"extn": "1721" "extn": "1721"
@ -204,7 +204,7 @@
"salary": "$132,000", "salary": "$132,000",
"start_date": { "start_date": {
"display": "Sat 13th Oct 12", "display": "Sat 13th Oct 12",
"timestamp": "1350082800" "timestamp": "1350086400"
}, },
"office": "London", "office": "London",
"extn": "2558" "extn": "2558"
@ -215,7 +215,7 @@
"salary": "$217,500", "salary": "$217,500",
"start_date": { "start_date": {
"display": "Wed 26th Sep 12", "display": "Wed 26th Sep 12",
"timestamp": "1348614000" "timestamp": "1348617600"
}, },
"office": "Edinburgh", "office": "Edinburgh",
"extn": "2290" "extn": "2290"
@ -226,7 +226,7 @@
"salary": "$345,000", "salary": "$345,000",
"start_date": { "start_date": {
"display": "Sat 3rd Sep 11", "display": "Sat 3rd Sep 11",
"timestamp": "1315004400" "timestamp": "1315008000"
}, },
"office": "New York", "office": "New York",
"extn": "1937" "extn": "1937"
@ -237,7 +237,7 @@
"salary": "$675,000", "salary": "$675,000",
"start_date": { "start_date": {
"display": "Thu 25th Jun 09", "display": "Thu 25th Jun 09",
"timestamp": "1245884400" "timestamp": "1245888000"
}, },
"office": "New York", "office": "New York",
"extn": "6154" "extn": "6154"
@ -259,7 +259,7 @@
"salary": "$85,600", "salary": "$85,600",
"start_date": { "start_date": {
"display": "Mon 20th Sep 10", "display": "Mon 20th Sep 10",
"timestamp": "1284937200" "timestamp": "1284940800"
}, },
"office": "Sidney", "office": "Sidney",
"extn": "3023" "extn": "3023"
@ -270,7 +270,7 @@
"salary": "$1,200,000", "salary": "$1,200,000",
"start_date": { "start_date": {
"display": "Fri 9th Oct 09", "display": "Fri 9th Oct 09",
"timestamp": "1255042800" "timestamp": "1255046400"
}, },
"office": "London", "office": "London",
"extn": "5797" "extn": "5797"
@ -303,7 +303,7 @@
"salary": "$206,850", "salary": "$206,850",
"start_date": { "start_date": {
"display": "Tue 7th Jun 11", "display": "Tue 7th Jun 11",
"timestamp": "1307401200" "timestamp": "1307404800"
}, },
"office": "San Francisco", "office": "San Francisco",
"extn": "1314" "extn": "1314"
@ -325,7 +325,7 @@
"salary": "$163,000", "salary": "$163,000",
"start_date": { "start_date": {
"display": "Sun 14th Aug 11", "display": "Sun 14th Aug 11",
"timestamp": "1313276400" "timestamp": "1313280000"
}, },
"office": "Tokyo", "office": "Tokyo",
"extn": "8899" "extn": "8899"
@ -336,7 +336,7 @@
"salary": "$95,400", "salary": "$95,400",
"start_date": { "start_date": {
"display": "Thu 2nd Jun 11", "display": "Thu 2nd Jun 11",
"timestamp": "1306969200" "timestamp": "1306972800"
}, },
"office": "Sidney", "office": "Sidney",
"extn": "2769" "extn": "2769"
@ -347,7 +347,7 @@
"salary": "$114,500", "salary": "$114,500",
"start_date": { "start_date": {
"display": "Thu 22nd Oct 09", "display": "Thu 22nd Oct 09",
"timestamp": "1256166000" "timestamp": "1256169600"
}, },
"office": "London", "office": "London",
"extn": "6832" "extn": "6832"
@ -358,7 +358,7 @@
"salary": "$145,000", "salary": "$145,000",
"start_date": { "start_date": {
"display": "Sat 7th May 11", "display": "Sat 7th May 11",
"timestamp": "1304722800" "timestamp": "1304726400"
}, },
"office": "London", "office": "London",
"extn": "3606" "extn": "3606"
@ -369,7 +369,7 @@
"salary": "$235,500", "salary": "$235,500",
"start_date": { "start_date": {
"display": "Sun 26th Oct 08", "display": "Sun 26th Oct 08",
"timestamp": "1224975600" "timestamp": "1224979200"
}, },
"office": "San Francisco", "office": "San Francisco",
"extn": "2860" "extn": "2860"
@ -446,7 +446,7 @@
"salary": "$645,750", "salary": "$645,750",
"start_date": { "start_date": {
"display": "Fri 26th Sep 08", "display": "Fri 26th Sep 08",
"timestamp": "1222383600" "timestamp": "1222387200"
}, },
"office": "New York", "office": "New York",
"extn": "1042" "extn": "1042"
@ -468,7 +468,7 @@
"salary": "$163,500", "salary": "$163,500",
"start_date": { "start_date": {
"display": "Tue 3rd May 11", "display": "Tue 3rd May 11",
"timestamp": "1304377200" "timestamp": "1304380800"
}, },
"office": "London", "office": "London",
"extn": "6222" "extn": "6222"
@ -479,7 +479,7 @@
"salary": "$139,575", "salary": "$139,575",
"start_date": { "start_date": {
"display": "Wed 19th Aug 09", "display": "Wed 19th Aug 09",
"timestamp": "1250636400" "timestamp": "1250640000"
}, },
"office": "Tokyo", "office": "Tokyo",
"extn": "9383" "extn": "9383"
@ -490,7 +490,7 @@
"salary": "$98,540", "salary": "$98,540",
"start_date": { "start_date": {
"display": "Sun 11th Aug 13", "display": "Sun 11th Aug 13",
"timestamp": "1376175600" "timestamp": "1376179200"
}, },
"office": "New York", "office": "New York",
"extn": "8327" "extn": "8327"
@ -501,7 +501,7 @@
"salary": "$87,500", "salary": "$87,500",
"start_date": { "start_date": {
"display": "Tue 7th Jul 09", "display": "Tue 7th Jul 09",
"timestamp": "1246921200" "timestamp": "1246924800"
}, },
"office": "San Francisco", "office": "San Francisco",
"extn": "2927" "extn": "2927"
@ -512,7 +512,7 @@
"salary": "$138,575", "salary": "$138,575",
"start_date": { "start_date": {
"display": "Mon 9th Apr 12", "display": "Mon 9th Apr 12",
"timestamp": "1333926000" "timestamp": "1333929600"
}, },
"office": "Singapore", "office": "Singapore",
"extn": "8352" "extn": "8352"
@ -534,7 +534,7 @@
"salary": "$115,000", "salary": "$115,000",
"start_date": { "start_date": {
"display": "Fri 1st Jun 12", "display": "Fri 1st Jun 12",
"timestamp": "1338505200" "timestamp": "1338508800"
}, },
"office": "San Francisco", "office": "San Francisco",
"extn": "4389" "extn": "4389"
@ -589,7 +589,7 @@
"salary": "$86,500", "salary": "$86,500",
"start_date": { "start_date": {
"display": "Wed 14th Jul 10", "display": "Wed 14th Jul 10",
"timestamp": "1279062000" "timestamp": "1279065600"
}, },
"office": "San Francisco", "office": "San Francisco",
"extn": "8196" "extn": "8196"
@ -611,7 +611,7 @@
"salary": "$183,000", "salary": "$183,000",
"start_date": { "start_date": {
"display": "Mon 27th Jun 11", "display": "Mon 27th Jun 11",
"timestamp": "1309129200" "timestamp": "1309132800"
}, },
"office": "Singapore", "office": "Singapore",
"extn": "5384" "extn": "5384"

View File

@ -1,26 +1,19 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<title>DataTables example - Nested object data (objects)</title>
<link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"> <title>DataTables example - Nested object data (objects)</title>
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"><link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<style type="text/css" class="init"> <style type="text/css" class="init">
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <script type="text/javascript" language="javascript" class="init">
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() { $(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
"processing": true, "processing": true,
@ -36,70 +29,50 @@ $(document).ready(function() {
} ); } );
} ); } );
</script> </script>
</head> </head>
<body class="dt-example"> <body class="dt-example ">
<div class="container"> <div class="container">
<section> <section>
<h1>DataTables example <span>Nested object data (objects)</span></h1> <h1>DataTables example <span>Nested object data (objects)</span></h1>
<div class="info"> <div class="info">
<p>DataTables has the ability to use data from almost any JSON data source through the use of the <a href= <p>DataTables has the ability to use data from almost any JSON data source through the use of the <a href="//datatables.net/reference/option/columns.data"><code class="option" title="DataTables initialisation option">columns.data</code></a> option. In its simplest case, it can be used to read arbitrary object properties, but can also be extended to <em>n</em> levels of nested objects / arrays through the use of standard Javascript dotted object notation. Each dot (<code>.</code>) in the <a href="//datatables.net/reference/option/columns.data"><code class="option" title="DataTables initialisation option">columns.data</code></a> option represents another object level.</p>
"//datatables.net/reference/option/columns.data"><code class="option" title="DataTables initialisation option">columns.data</code></a> option. In its simplest
case, it can be used to read arbitrary object properties, but can also be extended to <em>n</em> levels of nested objects / arrays through the use of standard <p>In this example <code>hr.position</code> refers to the <code>position</code> property of the <code>hr</code> object in the row's data source object, while <code>contact.0</code> refers to the first element of the <code>contact</code> array. Any number of dots can be used to obtain deeply nested data.</p>
Javascript dotted object notation. Each dot (<code>.</code>) in the <a href="//datatables.net/reference/option/columns.data"><code class="option" title=
"DataTables initialisation option">columns.data</code></a> option represents another object level.</p> <p>The example below shows DataTables reading information for the columns from nested objects and arrays, where the structure of the row's data source in this example is:</p>
<p>In this example <code>hr.position</code> refers to the <code>position</code> property of the <code>hr</code> object in the row's data source object, while
<code>contact.0</code> refers to the first element of the <code>contact</code> array. Any number of dots can be used to obtain deeply nested data.</p> <pre><code class="multiline">{
<p>The example below shows DataTables reading information for the columns from nested objects and arrays, where the structure of the row's data source in this "name": "Tiger Nixon",
example is:</p> "hr": {
<pre> "position": "System Architect",
<code class="multiline">{ "salary": "$3,120",
"name": "Tiger Nixon", "start_date": "2011/04/25"
"hr": { },
"position": "System Architect", "contact": [
"salary": "$3,120", "Edinburgh",
"start_date": "2011/04/25" "5421"
}, ]
"contact": [
"Edinburgh",
"5421"
]
} }
</code> </code></pre>
</pre>
</div> </div>
<table id="example" class="display" cellspacing="0" width="100%">
<thead>
<tr> <table id="example" class="display" cellspacing="0" width="100%"><thead><tr><th>Name</th><th>Position</th><th>Office</th><th>Extn.</th><th>Start date</th><th>Salary</th></tr></thead><tfoot><tr><th>Name</th><th>Position</th><th>Office</th><th>Extn.</th><th>Start date</th><th>Salary</th></tr></tfoot></table>
<th>Name</th>
<th>Position</th> <ul class="tabs">
<th>Office</th> <li class="active">Javascript</li>
<th>Extn.</th> <li>HTML</li>
<th>Start date</th> <li>CSS</li>
<th>Salary</th> <li>Ajax</li>
</tr> <li>Server-side script</li>
</thead> </ul>
<tfoot>
<tr> <div class="tabs">
<th>Name</th> <div class="js">
<th>Position</th> <p>The Javascript shown below is used to initialise the table shown in this example:</p>
<th>Office</th> <code class="multiline language-js">$(document).ready(function() {
<th>Extn.</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
&quot;processing&quot;: true, &quot;processing&quot;: true,
&quot;ajax&quot;: &quot;data/objects_deep.txt&quot;, &quot;ajax&quot;: &quot;data/objects_deep.txt&quot;,
@ -113,366 +86,153 @@ $(document).ready(function() {
] ]
} ); } );
} );</code> } );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul> <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<li> <ul><li><a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a></li><li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li></ul>
<a href="//code.jquery.com/jquery-1.12.3.js">//code.jquery.com/jquery-1.12.3.js</a> </div>
</li> <div class="table">
<li> <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
<a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a> </div>
</li> <div class="css">
</ul> <div>
</div> <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 additional CSS used is shown below:</p>
<div class="table"> <code class="multiline language-css"></code>
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p> </div>
</div>
<div class="css"> <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<div> <ul><li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li></ul>
<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 </div>
additional CSS used is shown below:</p><code class="multiline language-css"></code> <div class="ajax">
<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 loaded.</p>
</div>
<div class="php">
<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 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables documentation</a>.</p>
</div> </div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a>
</li>
</ul>
</div> </div>
<div class="ajax"> </section>
<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
loaded.</p>
</div> </div>
<div class="php">
<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 <section>
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables <div class="footer">
documentation</a>.</p> <div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group"><h3><a href="../basic_init/index.html
">Basic initialisation</a></h3><ul class="toc"><li><a href="../basic_init/zero_configuration.html
">Zero configuration</a></li><li><a href="../basic_init/filter_only.html
">Feature enable / disable</a></li><li><a href="../basic_init/table_sorting.html
">Default ordering (sorting)</a></li><li><a href="../basic_init/multi_col_sort.html
">Multi-column ordering</a></li><li><a href="../basic_init/multiple_tables.html
">Multiple tables</a></li><li><a href="../basic_init/hidden_columns.html
">Hidden columns</a></li><li><a href="../basic_init/complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="../basic_init/dom.html
">DOM positioning</a></li><li><a href="../basic_init/flexible_width.html
">Flexible table width</a></li><li><a href="../basic_init/state_save.html
">State saving</a></li><li><a href="../basic_init/alt_pagination.html
">Alternative pagination</a></li><li><a href="../basic_init/scroll_y.html
">Scroll - vertical</a></li><li><a href="../basic_init/scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="../basic_init/scroll_x.html
">Scroll - horizontal</a></li><li><a href="../basic_init/scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="../basic_init/comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="../basic_init/language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="../advanced_init/index.html
">Advanced initialisation</a></h3><ul class="toc"><li><a href="../advanced_init/events_live.html
">DOM / jQuery events</a></li><li><a href="../advanced_init/dt_events.html
">DataTables events</a></li><li><a href="../advanced_init/column_render.html
">Column rendering</a></li><li><a href="../advanced_init/length_menu.html
">Page length options</a></li><li><a href="../advanced_init/dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="../advanced_init/complex_header.html
">Complex headers with column visibility</a></li><li><a href="../advanced_init/object_dom_read.html
">Read HTML to data objects</a></li><li><a href="../advanced_init/html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="../advanced_init/html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="../advanced_init/language_file.html
">Language file</a></li><li><a href="../advanced_init/defaults.html
">Setting defaults</a></li><li><a href="../advanced_init/row_callback.html
">Row created callback</a></li><li><a href="../advanced_init/row_grouping.html
">Row grouping</a></li><li><a href="../advanced_init/footer_callback.html
">Footer callback</a></li><li><a href="../advanced_init/dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="../advanced_init/sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="../styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="../styling/display.html
">Base style</a></li><li><a href="../styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="../styling/cell-border.html
">Base style - cell borders</a></li><li><a href="../styling/compact.html
">Base style - compact</a></li><li><a href="../styling/hover.html
">Base style - hover</a></li><li><a href="../styling/order-column.html
">Base style - order-column</a></li><li><a href="../styling/row-border.html
">Base style - row borders</a></li><li><a href="../styling/stripe.html
">Base style - stripe</a></li><li><a href="../styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="../styling/foundation.html
">Foundation</a></li><li><a href="../styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="../styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="../styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="../styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="../styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="../data_sources/index.html
">Data sources</a></h3><ul class="toc"><li><a href="../data_sources/dom.html
">HTML (DOM) sourced data</a></li><li><a href="../data_sources/ajax.html
">Ajax sourced data</a></li><li><a href="../data_sources/js_array.html
">Javascript sourced data</a></li><li><a href="../data_sources/server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="../api/index.html
">API</a></h3><ul class="toc"><li><a href="../api/add_row.html
">Add rows</a></li><li><a href="../api/multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="../api/multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="../api/highlight.html
">Highlighting rows and columns</a></li><li><a href="../api/row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="../api/select_row.html
">Row selection (multiple rows)</a></li><li><a href="../api/select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="../api/form.html
">Form inputs</a></li><li><a href="../api/counter_columns.html
">Index column</a></li><li><a href="../api/show_hide.html
">Show / hide columns dynamically</a></li><li><a href="../api/api_in_init.html
">Using API in callbacks</a></li><li><a href="../api/tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="../api/regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="./index.html
">Ajax</a></h3><ul class="toc active"><li><a href="./simple.html
">Ajax data source (arrays)</a></li><li><a href="./objects.html
">Ajax data source (objects)</a></li><li class="active"><a href="./deep.html
">Nested object data (objects)</a></li><li><a href="./objects_subarrays.html
">Nested object data (arrays)</a></li><li><a href="./orthogonal-data.html
">Orthogonal data</a></li><li><a href="./null_data_source.html
">Generated content for a column</a></li><li><a href="./custom_data_property.html
">Custom data source property</a></li><li><a href="./custom_data_flat.html
">Flat array data source</a></li><li><a href="./defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="../server_side/index.html
">Server-side</a></h3><ul class="toc"><li><a href="../server_side/simple.html
">Server-side processing</a></li><li><a href="../server_side/custom_vars.html
">Custom HTTP variables</a></li><li><a href="../server_side/post.html
">POST data</a></li><li><a href="../server_side/ids.html
">Automatic addition of row ID attributes</a></li><li><a href="../server_side/object_data.html
">Object data source</a></li><li><a href="../server_side/row_details.html
">Row details</a></li><li><a href="../server_side/select_rows.html
">Row selection</a></li><li><a href="../server_side/jsonp.html
">JSONP data source for remote domains</a></li><li><a href="../server_side/defer_loading.html
">Deferred loading of data</a></li><li><a href="../server_side/pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="../plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="../plug-ins/api.html
">API plug-in methods</a></li><li><a href="../plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="../plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="../plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="../plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div> </div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="../basic_init/index.html">Basic initialisation</a></h3>
<ul class="toc">
<li>
<a href="../basic_init/zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="../basic_init/filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="../basic_init/table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="../basic_init/multi_col_sort.html">Multi-column ordering</a>
</li>
<li>
<a href="../basic_init/multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="../basic_init/hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="../basic_init/complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="../basic_init/dom.html">DOM positioning</a>
</li>
<li>
<a href="../basic_init/flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="../basic_init/state_save.html">State saving</a>
</li>
<li>
<a href="../basic_init/alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="../basic_init/scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="../basic_init/scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="../basic_init/scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="../basic_init/scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="../basic_init/comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="../basic_init/language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../advanced_init/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="../advanced_init/events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="../advanced_init/dt_events.html">DataTables events</a>
</li>
<li>
<a href="../advanced_init/column_render.html">Column rendering</a>
</li>
<li>
<a href="../advanced_init/length_menu.html">Page length options</a>
</li>
<li>
<a href="../advanced_init/dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="../advanced_init/complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="../advanced_init/object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="../advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="../advanced_init/language_file.html">Language file</a>
</li>
<li>
<a href="../advanced_init/defaults.html">Setting defaults</a>
</li>
<li>
<a href="../advanced_init/row_callback.html">Row created callback</a>
</li>
<li>
<a href="../advanced_init/row_grouping.html">Row grouping</a>
</li>
<li>
<a href="../advanced_init/footer_callback.html">Footer callback</a>
</li>
<li>
<a href="../advanced_init/dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="../advanced_init/sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/display.html">Base style</a>
</li>
<li>
<a href="../styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="../styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="../styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="../styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="../styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="../styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="../styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="../styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="../styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../data_sources/index.html">Data sources</a></h3>
<ul class="toc">
<li>
<a href="../data_sources/dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="../data_sources/ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="../data_sources/js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="../data_sources/server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="../api/add_row.html">Add rows</a>
</li>
<li>
<a href="../api/multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="../api/multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="../api/highlight.html">Highlighting rows and columns</a>
</li>
<li>
<a href="../api/row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="../api/select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="../api/select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="../api/form.html">Form inputs</a>
</li>
<li>
<a href="../api/counter_columns.html">Index column</a>
</li>
<li>
<a href="../api/show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="../api/api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="../api/tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="../api/regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./index.html">Ajax</a></h3>
<ul class="toc active">
<li>
<a href="./simple.html">Ajax data source (arrays)</a>
</li>
<li>
<a href="./objects.html">Ajax data source (objects)</a>
</li>
<li class="active">
<a href="./deep.html">Nested object data (objects)</a>
</li>
<li>
<a href="./objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="./orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="./null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="./custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="./custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="./defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../server_side/index.html">Server-side</a></h3>
<ul class="toc">
<li>
<a href="../server_side/simple.html">Server-side processing</a>
</li>
<li>
<a href="../server_side/custom_vars.html">Custom HTTP variables</a>
</li>
<li>
<a href="../server_side/post.html">POST data</a>
</li>
<li>
<a href="../server_side/ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="../server_side/object_data.html">Object data source</a>
</li>
<li>
<a href="../server_side/row_details.html">Row details</a>
</li>
<li>
<a href="../server_side/select_rows.html">Row selection</a>
</li>
<li>
<a href="../server_side/jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="../server_side/defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="../server_side/pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="../plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="../plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

View File

@ -1,26 +1,19 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<title>DataTables example - Deferred rendering for speed</title>
<link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"> <title>DataTables example - Deferred rendering for speed</title>
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"><link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<style type="text/css" class="init"> <style type="text/css" class="init">
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <script type="text/javascript" language="javascript" class="init">
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() { $(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
"ajax": "data/arrays.txt", "ajax": "data/arrays.txt",
@ -28,420 +21,188 @@ $(document).ready(function() {
} ); } );
} ); } );
</script> </script>
</head> </head>
<body class="dt-example"> <body class="dt-example ">
<div class="container"> <div class="container">
<section> <section>
<h1>DataTables example <span>Deferred rendering for speed</span></h1> <h1>DataTables example <span>Deferred rendering for speed</span></h1>
<div class="info"> <div class="info">
<p>When working with large data sources, you might seek to improve the speed at which DataTables runs. One method to do this is to make use of the built-in <p>When working with large data sources, you might seek to improve the speed at which DataTables runs. One method to do this is to make use of the built-in deferred rendering option in DataTables with the <a href="//datatables.net/reference/option/deferRender"><code class="option" title="DataTables initialisation option">deferRender</code></a> option.</p>
deferred rendering option in DataTables with the <a href="//datatables.net/reference/option/deferRender"><code class="option" title=
"DataTables initialisation option">deferRender</code></a> option.</p> <p>When deferred rendering is enabled, rather than having DataTables create all <code class="tag" title="HTML tag">TR</code> and <code class="tag" title="HTML tag">TD</code> nodes required for the table when the data is loaded, DataTables will only create the nodes required for each individual row at the time of that row being drawn on the page (these nodes are then retained in case they are needed again so they aren't created multiple times). This can give a significant performance increase, since a lot less work is done at initialisation time.</p>
<p>When deferred rendering is enabled, rather than having DataTables create all <code class="tag" title="HTML tag">TR</code> and <code class="tag" title=
"HTML tag">TD</code> nodes required for the table when the data is loaded, DataTables will only create the nodes required for each individual row at the time of <p>The example below shows DataTables with deferred rendering enabled. For this small example you'll likely notice no difference, but larger tables can benefit significantly from simply enabling this parameter.</p>
that row being drawn on the page (these nodes are then retained in case they are needed again so they aren't created multiple times). This can give a significant
performance increase, since a lot less work is done at initialisation time.</p> </div>
<p>The example below shows DataTables with deferred rendering enabled. For this small example you'll likely notice no difference, but larger tables can benefit
significantly from simply enabling this parameter.</p>
</div> <table id="example" class="display" cellspacing="0" width="100%"><thead><tr><th>Name</th><th>Position</th><th>Office</th><th>Extn.</th><th>Start date</th><th>Salary</th></tr></thead><tfoot><tr><th>Name</th><th>Position</th><th>Office</th><th>Extn.</th><th>Start date</th><th>Salary</th></tr></tfoot></table>
<table id="example" class="display" cellspacing="0" width="100%">
<thead> <ul class="tabs">
<tr> <li class="active">Javascript</li>
<th>Name</th> <li>HTML</li>
<th>Position</th> <li>CSS</li>
<th>Office</th> <li>Ajax</li>
<th>Extn.</th> <li>Server-side script</li>
<th>Start date</th> </ul>
<th>Salary</th>
</tr> <div class="tabs">
</thead> <div class="js">
<tfoot> <p>The Javascript shown below is used to initialise the table shown in this example:</p>
<tr> <code class="multiline language-js">$(document).ready(function() {
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Extn.</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
&quot;ajax&quot;: &quot;data/arrays.txt&quot;, &quot;ajax&quot;: &quot;data/arrays.txt&quot;,
&quot;deferRender&quot;: true &quot;deferRender&quot;: true
} ); } );
} );</code> } );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul> <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<li> <ul><li><a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a></li><li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li></ul>
<a href="//code.jquery.com/jquery-1.12.3.js">//code.jquery.com/jquery-1.12.3.js</a> </div>
</li> <div class="table">
<li> <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
<a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a> </div>
</li> <div class="css">
</ul> <div>
</div> <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 additional CSS used is shown below:</p>
<div class="table"> <code class="multiline language-css"></code>
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p> </div>
</div>
<div class="css"> <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<div> <ul><li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li></ul>
<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 </div>
additional CSS used is shown below:</p><code class="multiline language-css"></code> <div class="ajax">
<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 loaded.</p>
</div>
<div class="php">
<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 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables documentation</a>.</p>
</div> </div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a>
</li>
</ul>
</div> </div>
<div class="ajax"> </section>
<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
loaded.</p>
</div> </div>
<div class="php">
<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 <section>
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables <div class="footer">
documentation</a>.</p> <div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group"><h3><a href="../basic_init/index.html
">Basic initialisation</a></h3><ul class="toc"><li><a href="../basic_init/zero_configuration.html
">Zero configuration</a></li><li><a href="../basic_init/filter_only.html
">Feature enable / disable</a></li><li><a href="../basic_init/table_sorting.html
">Default ordering (sorting)</a></li><li><a href="../basic_init/multi_col_sort.html
">Multi-column ordering</a></li><li><a href="../basic_init/multiple_tables.html
">Multiple tables</a></li><li><a href="../basic_init/hidden_columns.html
">Hidden columns</a></li><li><a href="../basic_init/complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="../basic_init/dom.html
">DOM positioning</a></li><li><a href="../basic_init/flexible_width.html
">Flexible table width</a></li><li><a href="../basic_init/state_save.html
">State saving</a></li><li><a href="../basic_init/alt_pagination.html
">Alternative pagination</a></li><li><a href="../basic_init/scroll_y.html
">Scroll - vertical</a></li><li><a href="../basic_init/scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="../basic_init/scroll_x.html
">Scroll - horizontal</a></li><li><a href="../basic_init/scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="../basic_init/comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="../basic_init/language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="../advanced_init/index.html
">Advanced initialisation</a></h3><ul class="toc"><li><a href="../advanced_init/events_live.html
">DOM / jQuery events</a></li><li><a href="../advanced_init/dt_events.html
">DataTables events</a></li><li><a href="../advanced_init/column_render.html
">Column rendering</a></li><li><a href="../advanced_init/length_menu.html
">Page length options</a></li><li><a href="../advanced_init/dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="../advanced_init/complex_header.html
">Complex headers with column visibility</a></li><li><a href="../advanced_init/object_dom_read.html
">Read HTML to data objects</a></li><li><a href="../advanced_init/html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="../advanced_init/html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="../advanced_init/language_file.html
">Language file</a></li><li><a href="../advanced_init/defaults.html
">Setting defaults</a></li><li><a href="../advanced_init/row_callback.html
">Row created callback</a></li><li><a href="../advanced_init/row_grouping.html
">Row grouping</a></li><li><a href="../advanced_init/footer_callback.html
">Footer callback</a></li><li><a href="../advanced_init/dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="../advanced_init/sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="../styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="../styling/display.html
">Base style</a></li><li><a href="../styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="../styling/cell-border.html
">Base style - cell borders</a></li><li><a href="../styling/compact.html
">Base style - compact</a></li><li><a href="../styling/hover.html
">Base style - hover</a></li><li><a href="../styling/order-column.html
">Base style - order-column</a></li><li><a href="../styling/row-border.html
">Base style - row borders</a></li><li><a href="../styling/stripe.html
">Base style - stripe</a></li><li><a href="../styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="../styling/foundation.html
">Foundation</a></li><li><a href="../styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="../styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="../styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="../styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="../styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="../data_sources/index.html
">Data sources</a></h3><ul class="toc"><li><a href="../data_sources/dom.html
">HTML (DOM) sourced data</a></li><li><a href="../data_sources/ajax.html
">Ajax sourced data</a></li><li><a href="../data_sources/js_array.html
">Javascript sourced data</a></li><li><a href="../data_sources/server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="../api/index.html
">API</a></h3><ul class="toc"><li><a href="../api/add_row.html
">Add rows</a></li><li><a href="../api/multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="../api/multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="../api/highlight.html
">Highlighting rows and columns</a></li><li><a href="../api/row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="../api/select_row.html
">Row selection (multiple rows)</a></li><li><a href="../api/select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="../api/form.html
">Form inputs</a></li><li><a href="../api/counter_columns.html
">Index column</a></li><li><a href="../api/show_hide.html
">Show / hide columns dynamically</a></li><li><a href="../api/api_in_init.html
">Using API in callbacks</a></li><li><a href="../api/tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="../api/regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="./index.html
">Ajax</a></h3><ul class="toc active"><li><a href="./simple.html
">Ajax data source (arrays)</a></li><li><a href="./objects.html
">Ajax data source (objects)</a></li><li><a href="./deep.html
">Nested object data (objects)</a></li><li><a href="./objects_subarrays.html
">Nested object data (arrays)</a></li><li><a href="./orthogonal-data.html
">Orthogonal data</a></li><li><a href="./null_data_source.html
">Generated content for a column</a></li><li><a href="./custom_data_property.html
">Custom data source property</a></li><li><a href="./custom_data_flat.html
">Flat array data source</a></li><li class="active"><a href="./defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="../server_side/index.html
">Server-side</a></h3><ul class="toc"><li><a href="../server_side/simple.html
">Server-side processing</a></li><li><a href="../server_side/custom_vars.html
">Custom HTTP variables</a></li><li><a href="../server_side/post.html
">POST data</a></li><li><a href="../server_side/ids.html
">Automatic addition of row ID attributes</a></li><li><a href="../server_side/object_data.html
">Object data source</a></li><li><a href="../server_side/row_details.html
">Row details</a></li><li><a href="../server_side/select_rows.html
">Row selection</a></li><li><a href="../server_side/jsonp.html
">JSONP data source for remote domains</a></li><li><a href="../server_side/defer_loading.html
">Deferred loading of data</a></li><li><a href="../server_side/pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="../plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="../plug-ins/api.html
">API plug-in methods</a></li><li><a href="../plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="../plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="../plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="../plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div> </div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="../basic_init/index.html">Basic initialisation</a></h3>
<ul class="toc">
<li>
<a href="../basic_init/zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="../basic_init/filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="../basic_init/table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="../basic_init/multi_col_sort.html">Multi-column ordering</a>
</li>
<li>
<a href="../basic_init/multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="../basic_init/hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="../basic_init/complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="../basic_init/dom.html">DOM positioning</a>
</li>
<li>
<a href="../basic_init/flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="../basic_init/state_save.html">State saving</a>
</li>
<li>
<a href="../basic_init/alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="../basic_init/scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="../basic_init/scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="../basic_init/scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="../basic_init/scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="../basic_init/comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="../basic_init/language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../advanced_init/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="../advanced_init/events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="../advanced_init/dt_events.html">DataTables events</a>
</li>
<li>
<a href="../advanced_init/column_render.html">Column rendering</a>
</li>
<li>
<a href="../advanced_init/length_menu.html">Page length options</a>
</li>
<li>
<a href="../advanced_init/dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="../advanced_init/complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="../advanced_init/object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="../advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="../advanced_init/language_file.html">Language file</a>
</li>
<li>
<a href="../advanced_init/defaults.html">Setting defaults</a>
</li>
<li>
<a href="../advanced_init/row_callback.html">Row created callback</a>
</li>
<li>
<a href="../advanced_init/row_grouping.html">Row grouping</a>
</li>
<li>
<a href="../advanced_init/footer_callback.html">Footer callback</a>
</li>
<li>
<a href="../advanced_init/dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="../advanced_init/sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/display.html">Base style</a>
</li>
<li>
<a href="../styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="../styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="../styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="../styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="../styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="../styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="../styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="../styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="../styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../data_sources/index.html">Data sources</a></h3>
<ul class="toc">
<li>
<a href="../data_sources/dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="../data_sources/ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="../data_sources/js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="../data_sources/server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="../api/add_row.html">Add rows</a>
</li>
<li>
<a href="../api/multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="../api/multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="../api/highlight.html">Highlighting rows and columns</a>
</li>
<li>
<a href="../api/row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="../api/select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="../api/select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="../api/form.html">Form inputs</a>
</li>
<li>
<a href="../api/counter_columns.html">Index column</a>
</li>
<li>
<a href="../api/show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="../api/api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="../api/tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="../api/regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./index.html">Ajax</a></h3>
<ul class="toc active">
<li>
<a href="./simple.html">Ajax data source (arrays)</a>
</li>
<li>
<a href="./objects.html">Ajax data source (objects)</a>
</li>
<li>
<a href="./deep.html">Nested object data (objects)</a>
</li>
<li>
<a href="./objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="./orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="./null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="./custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="./custom_data_flat.html">Flat array data source</a>
</li>
<li class="active">
<a href="./defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../server_side/index.html">Server-side</a></h3>
<ul class="toc">
<li>
<a href="../server_side/simple.html">Server-side processing</a>
</li>
<li>
<a href="../server_side/custom_vars.html">Custom HTTP variables</a>
</li>
<li>
<a href="../server_side/post.html">POST data</a>
</li>
<li>
<a href="../server_side/ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="../server_side/object_data.html">Object data source</a>
</li>
<li>
<a href="../server_side/row_details.html">Row details</a>
</li>
<li>
<a href="../server_side/select_rows.html">Row selection</a>
</li>
<li>
<a href="../server_side/jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="../server_side/defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="../server_side/pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="../plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="../plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

View File

@ -1,78 +1,58 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <title>DataTables examples - Ajax sourced data</title>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"> </head>
</script> <body class="dt-example">
<script type="text/javascript" language="javascript" src="../resources/demo.js"> <div class="container">
</script> <section>
<title>DataTables examples - Ajax sourced data</title> <h1>DataTables example <span>Ajax sourced data</span></h1>
</head> <div class="info">
<body class="dt-example"> <p>DataTables can read data from a server via Ajax, while still performing searching, ordering, paging etc on the client-side. This is done through use of the <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> option, which has a number of options to customise how the data is retrieved from the server.</p>
<div class="container">
<p>The examples in this section demonstrate the use of Ajax loading data in DataTables, with client-side processing.</p>
</div>
</section>
</div>
<section> <section>
<h1>DataTables example <span>Ajax sourced data</span></h1> <div class="footer">
<div class="info"> <div class="gradient"></div>
<p>DataTables can read data from a server via Ajax, while still performing searching, ordering, paging etc on the client-side. This is done through use of the <div class="liner">
<a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> option, which has a number of <div class="toc">
options to customise how the data is retrieved from the server.</p> <div class="toc-group"><h3><a href="./index.html
<p>The examples in this section demonstrate the use of Ajax loading data in DataTables, with client-side processing.</p> ">Ajax</a></h3><ul class="toc"><li><a href="./simple.html
</div> ">Ajax data source (arrays)</a></li><li><a href="./objects.html
</section> ">Ajax data source (objects)</a></li><li><a href="./deep.html
</div> ">Nested object data (objects)</a></li><li><a href="./objects_subarrays.html
<section> ">Nested object data (arrays)</a></li><li><a href="./orthogonal-data.html
<div class="footer"> ">Orthogonal data</a></li><li><a href="./null_data_source.html
<div class="gradient"></div> ">Generated content for a column</a></li><li><a href="./custom_data_property.html
<div class="liner"> ">Custom data source property</a></li><li><a href="./custom_data_flat.html
<div class="toc"> ">Flat array data source</a></li><li><a href="./defer_render.html
<div class="toc-group"> ">Deferred rendering for speed</a></li></ul></div>
<h3><a href="./index.html">Ajax</a></h3> </div>
<ul class="toc">
<li> <div class="epilogue">
<a href="./simple.html">Ajax data source (arrays)</a> <p>
</li> Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
<li> Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
<a href="./objects.html">Ajax data source (objects)</a> </p>
</li>
<li> <p class="copyright">
<a href="./deep.html">Nested object data (objects)</a> DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
</li> DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
<li> </p>
<a href="./objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="./orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="./null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="./custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="./custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="./defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div> </div>
</div> </div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div> </div>
</div> </section>
</section> </body>
</body>
</html> </html>

View File

@ -1,26 +1,19 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<title>DataTables example - Generated content for a column</title>
<link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"> <title>DataTables example - Generated content for a column</title>
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"><link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<style type="text/css" class="init"> <style type="text/css" class="init">
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <script type="text/javascript" language="javascript" class="init">
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() { $(document).ready(function() {
var table = $('#example').DataTable( { var table = $('#example').DataTable( {
"ajax": "data/arrays.txt", "ajax": "data/arrays.txt",
@ -37,65 +30,41 @@ $(document).ready(function() {
} ); } );
} ); } );
</script> </script>
</head> </head>
<body class="dt-example"> <body class="dt-example ">
<div class="container"> <div class="container">
<section> <section>
<h1>DataTables example <span>Generated content for a column</span></h1> <h1>DataTables example <span>Generated content for a column</span></h1>
<div class="info"> <div class="info">
<p>In some tables you might wish to have some content generated automatically. This can be done in a number of ways:</p> <p>In some tables you might wish to have some content generated automatically. This can be done in a number of ways:</p>
<ul class="markdown">
<li> <ul class="markdown">
<a href="//datatables.net/reference/option/columns.render"><code class="option" title="DataTables initialisation option">columns.render</code></a> for <li><a href="//datatables.net/reference/option/columns.render"><code class="option" title="DataTables initialisation option">columns.render</code></a> for content that is dynamic (i.e. based upon the row's data)</li>
content that is dynamic (i.e. based upon the row's data) <li><a href="//datatables.net/reference/option/columns.defaultContent"><code class="option" title="DataTables initialisation option">columns.defaultContent</code></a> for static content (i.e. simple strings)</li>
</li> </ul>
<li>
<a href="//datatables.net/reference/option/columns.defaultContent"><code class="option" title= <p>This examples shows the use of <a href="//datatables.net/reference/option/columns.defaultContent"><code class="option" title="DataTables initialisation option">columns.defaultContent</code></a> to create a <em>button</em> element in the last column of the table. A simple jQuery <code>click</code> event listener is used to watch for clicks on the row, and when activated uses the <a href="//datatables.net/reference/api/row().data()"><code class="api" title="DataTables API method">row().data()</code></a> method to get the data for the row and show a bit of information about it in an <code>alert</code> box. This is a simple use case, but it can be built up to be arbitrarily complex.</p>
"DataTables initialisation option">columns.defaultContent</code></a> for static content (i.e. simple strings)
</li> <p>Note also that the <a href="//datatables.net/reference/option/columns.data"><code class="option" title="DataTables initialisation option">columns.data</code></a> option for the column has been set to <code>null</code> to indicate that the column has no information that should be obtained data source object.</p>
</div>
<table id="example" class="display" cellspacing="0" width="100%"><thead><tr><th>Name</th><th>Position</th><th>Office</th><th>Extn.</th><th>Start date</th><th>Salary</th></tr></thead><tfoot><tr><th>Name</th><th>Position</th><th>Office</th><th>Extn.</th><th>Start date</th><th>Salary</th></tr></tfoot></table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul> </ul>
<p>This examples shows the use of <a href="//datatables.net/reference/option/columns.defaultContent"><code class="option" title=
"DataTables initialisation option">columns.defaultContent</code></a> to create a <em>button</em> element in the last column of the table. A simple jQuery <div class="tabs">
<code>click</code> event listener is used to watch for clicks on the row, and when activated uses the <a href= <div class="js">
"//datatables.net/reference/api/row().data()"><code class="api" title="DataTables API method">row().data()</code></a> method to get the data for the row and show a <p>The Javascript shown below is used to initialise the table shown in this example:</p>
bit of information about it in an <code>alert</code> box. This is a simple use case, but it can be built up to be arbitrarily complex.</p> <code class="multiline language-js">$(document).ready(function() {
<p>Note also that the <a href="//datatables.net/reference/option/columns.data"><code class="option" title=
"DataTables initialisation option">columns.data</code></a> option for the column has been set to <code>null</code> to indicate that the column has no information
that should be obtained data source object.</p>
</div>
<table id="example" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Extn.</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Extn.</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
var table = $('#example').DataTable( { var table = $('#example').DataTable( {
&quot;ajax&quot;: &quot;data/arrays.txt&quot;, &quot;ajax&quot;: &quot;data/arrays.txt&quot;,
&quot;columnDefs&quot;: [ { &quot;columnDefs&quot;: [ {
@ -110,366 +79,153 @@ $(document).ready(function() {
alert( data[0] +&quot;'s salary is: &quot;+ data[ 5 ] ); alert( data[0] +&quot;'s salary is: &quot;+ data[ 5 ] );
} ); } );
} );</code> } );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul> <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<li> <ul><li><a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a></li><li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li></ul>
<a href="//code.jquery.com/jquery-1.12.3.js">//code.jquery.com/jquery-1.12.3.js</a> </div>
</li> <div class="table">
<li> <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
<a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a> </div>
</li> <div class="css">
</ul> <div>
</div> <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 additional CSS used is shown below:</p>
<div class="table"> <code class="multiline language-css"></code>
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p> </div>
</div>
<div class="css"> <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<div> <ul><li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li></ul>
<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 </div>
additional CSS used is shown below:</p><code class="multiline language-css"></code> <div class="ajax">
<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 loaded.</p>
</div>
<div class="php">
<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 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables documentation</a>.</p>
</div> </div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a>
</li>
</ul>
</div> </div>
<div class="ajax"> </section>
<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
loaded.</p>
</div> </div>
<div class="php">
<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 <section>
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables <div class="footer">
documentation</a>.</p> <div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group"><h3><a href="../basic_init/index.html
">Basic initialisation</a></h3><ul class="toc"><li><a href="../basic_init/zero_configuration.html
">Zero configuration</a></li><li><a href="../basic_init/filter_only.html
">Feature enable / disable</a></li><li><a href="../basic_init/table_sorting.html
">Default ordering (sorting)</a></li><li><a href="../basic_init/multi_col_sort.html
">Multi-column ordering</a></li><li><a href="../basic_init/multiple_tables.html
">Multiple tables</a></li><li><a href="../basic_init/hidden_columns.html
">Hidden columns</a></li><li><a href="../basic_init/complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="../basic_init/dom.html
">DOM positioning</a></li><li><a href="../basic_init/flexible_width.html
">Flexible table width</a></li><li><a href="../basic_init/state_save.html
">State saving</a></li><li><a href="../basic_init/alt_pagination.html
">Alternative pagination</a></li><li><a href="../basic_init/scroll_y.html
">Scroll - vertical</a></li><li><a href="../basic_init/scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="../basic_init/scroll_x.html
">Scroll - horizontal</a></li><li><a href="../basic_init/scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="../basic_init/comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="../basic_init/language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="../advanced_init/index.html
">Advanced initialisation</a></h3><ul class="toc"><li><a href="../advanced_init/events_live.html
">DOM / jQuery events</a></li><li><a href="../advanced_init/dt_events.html
">DataTables events</a></li><li><a href="../advanced_init/column_render.html
">Column rendering</a></li><li><a href="../advanced_init/length_menu.html
">Page length options</a></li><li><a href="../advanced_init/dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="../advanced_init/complex_header.html
">Complex headers with column visibility</a></li><li><a href="../advanced_init/object_dom_read.html
">Read HTML to data objects</a></li><li><a href="../advanced_init/html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="../advanced_init/html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="../advanced_init/language_file.html
">Language file</a></li><li><a href="../advanced_init/defaults.html
">Setting defaults</a></li><li><a href="../advanced_init/row_callback.html
">Row created callback</a></li><li><a href="../advanced_init/row_grouping.html
">Row grouping</a></li><li><a href="../advanced_init/footer_callback.html
">Footer callback</a></li><li><a href="../advanced_init/dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="../advanced_init/sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="../styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="../styling/display.html
">Base style</a></li><li><a href="../styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="../styling/cell-border.html
">Base style - cell borders</a></li><li><a href="../styling/compact.html
">Base style - compact</a></li><li><a href="../styling/hover.html
">Base style - hover</a></li><li><a href="../styling/order-column.html
">Base style - order-column</a></li><li><a href="../styling/row-border.html
">Base style - row borders</a></li><li><a href="../styling/stripe.html
">Base style - stripe</a></li><li><a href="../styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="../styling/foundation.html
">Foundation</a></li><li><a href="../styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="../styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="../styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="../styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="../styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="../data_sources/index.html
">Data sources</a></h3><ul class="toc"><li><a href="../data_sources/dom.html
">HTML (DOM) sourced data</a></li><li><a href="../data_sources/ajax.html
">Ajax sourced data</a></li><li><a href="../data_sources/js_array.html
">Javascript sourced data</a></li><li><a href="../data_sources/server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="../api/index.html
">API</a></h3><ul class="toc"><li><a href="../api/add_row.html
">Add rows</a></li><li><a href="../api/multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="../api/multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="../api/highlight.html
">Highlighting rows and columns</a></li><li><a href="../api/row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="../api/select_row.html
">Row selection (multiple rows)</a></li><li><a href="../api/select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="../api/form.html
">Form inputs</a></li><li><a href="../api/counter_columns.html
">Index column</a></li><li><a href="../api/show_hide.html
">Show / hide columns dynamically</a></li><li><a href="../api/api_in_init.html
">Using API in callbacks</a></li><li><a href="../api/tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="../api/regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="./index.html
">Ajax</a></h3><ul class="toc active"><li><a href="./simple.html
">Ajax data source (arrays)</a></li><li><a href="./objects.html
">Ajax data source (objects)</a></li><li><a href="./deep.html
">Nested object data (objects)</a></li><li><a href="./objects_subarrays.html
">Nested object data (arrays)</a></li><li><a href="./orthogonal-data.html
">Orthogonal data</a></li><li class="active"><a href="./null_data_source.html
">Generated content for a column</a></li><li><a href="./custom_data_property.html
">Custom data source property</a></li><li><a href="./custom_data_flat.html
">Flat array data source</a></li><li><a href="./defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="../server_side/index.html
">Server-side</a></h3><ul class="toc"><li><a href="../server_side/simple.html
">Server-side processing</a></li><li><a href="../server_side/custom_vars.html
">Custom HTTP variables</a></li><li><a href="../server_side/post.html
">POST data</a></li><li><a href="../server_side/ids.html
">Automatic addition of row ID attributes</a></li><li><a href="../server_side/object_data.html
">Object data source</a></li><li><a href="../server_side/row_details.html
">Row details</a></li><li><a href="../server_side/select_rows.html
">Row selection</a></li><li><a href="../server_side/jsonp.html
">JSONP data source for remote domains</a></li><li><a href="../server_side/defer_loading.html
">Deferred loading of data</a></li><li><a href="../server_side/pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="../plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="../plug-ins/api.html
">API plug-in methods</a></li><li><a href="../plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="../plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="../plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="../plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div> </div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="../basic_init/index.html">Basic initialisation</a></h3>
<ul class="toc">
<li>
<a href="../basic_init/zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="../basic_init/filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="../basic_init/table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="../basic_init/multi_col_sort.html">Multi-column ordering</a>
</li>
<li>
<a href="../basic_init/multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="../basic_init/hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="../basic_init/complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="../basic_init/dom.html">DOM positioning</a>
</li>
<li>
<a href="../basic_init/flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="../basic_init/state_save.html">State saving</a>
</li>
<li>
<a href="../basic_init/alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="../basic_init/scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="../basic_init/scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="../basic_init/scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="../basic_init/scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="../basic_init/comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="../basic_init/language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../advanced_init/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="../advanced_init/events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="../advanced_init/dt_events.html">DataTables events</a>
</li>
<li>
<a href="../advanced_init/column_render.html">Column rendering</a>
</li>
<li>
<a href="../advanced_init/length_menu.html">Page length options</a>
</li>
<li>
<a href="../advanced_init/dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="../advanced_init/complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="../advanced_init/object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="../advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="../advanced_init/language_file.html">Language file</a>
</li>
<li>
<a href="../advanced_init/defaults.html">Setting defaults</a>
</li>
<li>
<a href="../advanced_init/row_callback.html">Row created callback</a>
</li>
<li>
<a href="../advanced_init/row_grouping.html">Row grouping</a>
</li>
<li>
<a href="../advanced_init/footer_callback.html">Footer callback</a>
</li>
<li>
<a href="../advanced_init/dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="../advanced_init/sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/display.html">Base style</a>
</li>
<li>
<a href="../styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="../styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="../styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="../styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="../styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="../styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="../styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="../styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="../styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../data_sources/index.html">Data sources</a></h3>
<ul class="toc">
<li>
<a href="../data_sources/dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="../data_sources/ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="../data_sources/js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="../data_sources/server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="../api/add_row.html">Add rows</a>
</li>
<li>
<a href="../api/multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="../api/multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="../api/highlight.html">Highlighting rows and columns</a>
</li>
<li>
<a href="../api/row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="../api/select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="../api/select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="../api/form.html">Form inputs</a>
</li>
<li>
<a href="../api/counter_columns.html">Index column</a>
</li>
<li>
<a href="../api/show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="../api/api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="../api/tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="../api/regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./index.html">Ajax</a></h3>
<ul class="toc active">
<li>
<a href="./simple.html">Ajax data source (arrays)</a>
</li>
<li>
<a href="./objects.html">Ajax data source (objects)</a>
</li>
<li>
<a href="./deep.html">Nested object data (objects)</a>
</li>
<li>
<a href="./objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="./orthogonal-data.html">Orthogonal data</a>
</li>
<li class="active">
<a href="./null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="./custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="./custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="./defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../server_side/index.html">Server-side</a></h3>
<ul class="toc">
<li>
<a href="../server_side/simple.html">Server-side processing</a>
</li>
<li>
<a href="../server_side/custom_vars.html">Custom HTTP variables</a>
</li>
<li>
<a href="../server_side/post.html">POST data</a>
</li>
<li>
<a href="../server_side/ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="../server_side/object_data.html">Object data source</a>
</li>
<li>
<a href="../server_side/row_details.html">Row details</a>
</li>
<li>
<a href="../server_side/select_rows.html">Row selection</a>
</li>
<li>
<a href="../server_side/jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="../server_side/defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="../server_side/pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="../plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="../plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

View File

@ -1,26 +1,19 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<title>DataTables example - Ajax data source (objects)</title>
<link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"> <title>DataTables example - Ajax data source (objects)</title>
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"><link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<style type="text/css" class="init"> <style type="text/css" class="init">
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <script type="text/javascript" language="javascript" class="init">
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() { $(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
"ajax": "data/objects.txt", "ajax": "data/objects.txt",
@ -35,66 +28,48 @@ $(document).ready(function() {
} ); } );
} ); } );
</script> </script>
</head> </head>
<body class="dt-example"> <body class="dt-example ">
<div class="container"> <div class="container">
<section> <section>
<h1>DataTables example <span>Ajax data source (objects)</span></h1> <h1>DataTables example <span>Ajax data source (objects)</span></h1>
<div class="info"> <div class="info">
<p>To try and make life easy, by default, DataTables expects arrays to be used as the data source for rows in the table. However, this isn't always useful, and you <p>To try and make life easy, by default, DataTables expects arrays to be used as the data source for rows in the table. However, this isn't always useful, and you may wish to have DataTables use objects as the data source for each row (i.e. each row has its data described by an object) as this can make working with the data much more understandable, particularly if you are using the API and you don't need to keep track of array indexes.</p>
may wish to have DataTables use objects as the data source for each row (i.e. each row has its data described by an object) as this can make working with the data
much more understandable, particularly if you are using the API and you don't need to keep track of array indexes.</p> <p>This can be done quite simply by using the <a href="//datatables.net/reference/option/columns.data"><code class="option" title="DataTables initialisation option">columns.data</code></a> option which you use to tell DataTables which property to use from the data source object for each column.</p>
<p>This can be done quite simply by using the <a href="//datatables.net/reference/option/columns.data"><code class="option" title=
"DataTables initialisation option">columns.data</code></a> option which you use to tell DataTables which property to use from the data source object for each <p>In this example the Ajax source returns an array of objects, which DataTables uses to display the table. The structure of the row's data source in this example is:</p>
column.</p>
<p>In this example the Ajax source returns an array of objects, which DataTables uses to display the table. The structure of the row's data source in this example <pre><code class="multiline">{
is:</p> "name": "Tiger Nixon",
<pre> "position": "System Architect",
<code class="multiline">{ "salary": "$3,120",
"name": "Tiger Nixon", "start_date": "2011/04/25",
"position": "System Architect", "office": "Edinburgh",
"salary": "$3,120", "extn": "5421"
"start_date": "2011/04/25",
"office": "Edinburgh",
"extn": "5421"
} }
</code> </code></pre>
</pre>
<p>For more details on loading a DataTable with Ajax data, please refer to the <a href="https://datatables.net/manual/ajax">Ajax section of the manual</a>.</p> <p>For more details on loading a DataTable with Ajax data, please refer to the <a href="https://datatables.net/manual/ajax">Ajax section of the manual</a>.</p>
</div>
<table id="example" class="display" cellspacing="0" width="100%"> </div>
<thead>
<tr>
<th>Name</th> <table id="example" class="display" cellspacing="0" width="100%"><thead><tr><th>Name</th><th>Position</th><th>Office</th><th>Extn.</th><th>Start date</th><th>Salary</th></tr></thead><tfoot><tr><th>Name</th><th>Position</th><th>Office</th><th>Extn.</th><th>Start date</th><th>Salary</th></tr></tfoot></table>
<th>Position</th>
<th>Office</th> <ul class="tabs">
<th>Extn.</th> <li class="active">Javascript</li>
<th>Start date</th> <li>HTML</li>
<th>Salary</th> <li>CSS</li>
</tr> <li>Ajax</li>
</thead> <li>Server-side script</li>
<tfoot> </ul>
<tr>
<th>Name</th> <div class="tabs">
<th>Position</th> <div class="js">
<th>Office</th> <p>The Javascript shown below is used to initialise the table shown in this example:</p>
<th>Extn.</th> <code class="multiline language-js">$(document).ready(function() {
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
&quot;ajax&quot;: &quot;data/objects.txt&quot;, &quot;ajax&quot;: &quot;data/objects.txt&quot;,
&quot;columns&quot;: [ &quot;columns&quot;: [
@ -107,366 +82,153 @@ $(document).ready(function() {
] ]
} ); } );
} );</code> } );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul> <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<li> <ul><li><a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a></li><li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li></ul>
<a href="//code.jquery.com/jquery-1.12.3.js">//code.jquery.com/jquery-1.12.3.js</a> </div>
</li> <div class="table">
<li> <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
<a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a> </div>
</li> <div class="css">
</ul> <div>
</div> <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 additional CSS used is shown below:</p>
<div class="table"> <code class="multiline language-css"></code>
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p> </div>
</div>
<div class="css"> <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<div> <ul><li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li></ul>
<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 </div>
additional CSS used is shown below:</p><code class="multiline language-css"></code> <div class="ajax">
<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 loaded.</p>
</div>
<div class="php">
<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 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables documentation</a>.</p>
</div> </div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a>
</li>
</ul>
</div> </div>
<div class="ajax"> </section>
<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
loaded.</p>
</div> </div>
<div class="php">
<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 <section>
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables <div class="footer">
documentation</a>.</p> <div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group"><h3><a href="../basic_init/index.html
">Basic initialisation</a></h3><ul class="toc"><li><a href="../basic_init/zero_configuration.html
">Zero configuration</a></li><li><a href="../basic_init/filter_only.html
">Feature enable / disable</a></li><li><a href="../basic_init/table_sorting.html
">Default ordering (sorting)</a></li><li><a href="../basic_init/multi_col_sort.html
">Multi-column ordering</a></li><li><a href="../basic_init/multiple_tables.html
">Multiple tables</a></li><li><a href="../basic_init/hidden_columns.html
">Hidden columns</a></li><li><a href="../basic_init/complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="../basic_init/dom.html
">DOM positioning</a></li><li><a href="../basic_init/flexible_width.html
">Flexible table width</a></li><li><a href="../basic_init/state_save.html
">State saving</a></li><li><a href="../basic_init/alt_pagination.html
">Alternative pagination</a></li><li><a href="../basic_init/scroll_y.html
">Scroll - vertical</a></li><li><a href="../basic_init/scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="../basic_init/scroll_x.html
">Scroll - horizontal</a></li><li><a href="../basic_init/scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="../basic_init/comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="../basic_init/language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="../advanced_init/index.html
">Advanced initialisation</a></h3><ul class="toc"><li><a href="../advanced_init/events_live.html
">DOM / jQuery events</a></li><li><a href="../advanced_init/dt_events.html
">DataTables events</a></li><li><a href="../advanced_init/column_render.html
">Column rendering</a></li><li><a href="../advanced_init/length_menu.html
">Page length options</a></li><li><a href="../advanced_init/dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="../advanced_init/complex_header.html
">Complex headers with column visibility</a></li><li><a href="../advanced_init/object_dom_read.html
">Read HTML to data objects</a></li><li><a href="../advanced_init/html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="../advanced_init/html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="../advanced_init/language_file.html
">Language file</a></li><li><a href="../advanced_init/defaults.html
">Setting defaults</a></li><li><a href="../advanced_init/row_callback.html
">Row created callback</a></li><li><a href="../advanced_init/row_grouping.html
">Row grouping</a></li><li><a href="../advanced_init/footer_callback.html
">Footer callback</a></li><li><a href="../advanced_init/dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="../advanced_init/sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="../styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="../styling/display.html
">Base style</a></li><li><a href="../styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="../styling/cell-border.html
">Base style - cell borders</a></li><li><a href="../styling/compact.html
">Base style - compact</a></li><li><a href="../styling/hover.html
">Base style - hover</a></li><li><a href="../styling/order-column.html
">Base style - order-column</a></li><li><a href="../styling/row-border.html
">Base style - row borders</a></li><li><a href="../styling/stripe.html
">Base style - stripe</a></li><li><a href="../styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="../styling/foundation.html
">Foundation</a></li><li><a href="../styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="../styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="../styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="../styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="../styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="../data_sources/index.html
">Data sources</a></h3><ul class="toc"><li><a href="../data_sources/dom.html
">HTML (DOM) sourced data</a></li><li><a href="../data_sources/ajax.html
">Ajax sourced data</a></li><li><a href="../data_sources/js_array.html
">Javascript sourced data</a></li><li><a href="../data_sources/server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="../api/index.html
">API</a></h3><ul class="toc"><li><a href="../api/add_row.html
">Add rows</a></li><li><a href="../api/multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="../api/multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="../api/highlight.html
">Highlighting rows and columns</a></li><li><a href="../api/row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="../api/select_row.html
">Row selection (multiple rows)</a></li><li><a href="../api/select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="../api/form.html
">Form inputs</a></li><li><a href="../api/counter_columns.html
">Index column</a></li><li><a href="../api/show_hide.html
">Show / hide columns dynamically</a></li><li><a href="../api/api_in_init.html
">Using API in callbacks</a></li><li><a href="../api/tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="../api/regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="./index.html
">Ajax</a></h3><ul class="toc active"><li><a href="./simple.html
">Ajax data source (arrays)</a></li><li class="active"><a href="./objects.html
">Ajax data source (objects)</a></li><li><a href="./deep.html
">Nested object data (objects)</a></li><li><a href="./objects_subarrays.html
">Nested object data (arrays)</a></li><li><a href="./orthogonal-data.html
">Orthogonal data</a></li><li><a href="./null_data_source.html
">Generated content for a column</a></li><li><a href="./custom_data_property.html
">Custom data source property</a></li><li><a href="./custom_data_flat.html
">Flat array data source</a></li><li><a href="./defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="../server_side/index.html
">Server-side</a></h3><ul class="toc"><li><a href="../server_side/simple.html
">Server-side processing</a></li><li><a href="../server_side/custom_vars.html
">Custom HTTP variables</a></li><li><a href="../server_side/post.html
">POST data</a></li><li><a href="../server_side/ids.html
">Automatic addition of row ID attributes</a></li><li><a href="../server_side/object_data.html
">Object data source</a></li><li><a href="../server_side/row_details.html
">Row details</a></li><li><a href="../server_side/select_rows.html
">Row selection</a></li><li><a href="../server_side/jsonp.html
">JSONP data source for remote domains</a></li><li><a href="../server_side/defer_loading.html
">Deferred loading of data</a></li><li><a href="../server_side/pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="../plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="../plug-ins/api.html
">API plug-in methods</a></li><li><a href="../plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="../plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="../plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="../plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div> </div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="../basic_init/index.html">Basic initialisation</a></h3>
<ul class="toc">
<li>
<a href="../basic_init/zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="../basic_init/filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="../basic_init/table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="../basic_init/multi_col_sort.html">Multi-column ordering</a>
</li>
<li>
<a href="../basic_init/multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="../basic_init/hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="../basic_init/complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="../basic_init/dom.html">DOM positioning</a>
</li>
<li>
<a href="../basic_init/flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="../basic_init/state_save.html">State saving</a>
</li>
<li>
<a href="../basic_init/alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="../basic_init/scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="../basic_init/scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="../basic_init/scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="../basic_init/scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="../basic_init/comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="../basic_init/language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../advanced_init/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="../advanced_init/events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="../advanced_init/dt_events.html">DataTables events</a>
</li>
<li>
<a href="../advanced_init/column_render.html">Column rendering</a>
</li>
<li>
<a href="../advanced_init/length_menu.html">Page length options</a>
</li>
<li>
<a href="../advanced_init/dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="../advanced_init/complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="../advanced_init/object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="../advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="../advanced_init/language_file.html">Language file</a>
</li>
<li>
<a href="../advanced_init/defaults.html">Setting defaults</a>
</li>
<li>
<a href="../advanced_init/row_callback.html">Row created callback</a>
</li>
<li>
<a href="../advanced_init/row_grouping.html">Row grouping</a>
</li>
<li>
<a href="../advanced_init/footer_callback.html">Footer callback</a>
</li>
<li>
<a href="../advanced_init/dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="../advanced_init/sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/display.html">Base style</a>
</li>
<li>
<a href="../styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="../styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="../styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="../styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="../styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="../styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="../styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="../styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="../styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../data_sources/index.html">Data sources</a></h3>
<ul class="toc">
<li>
<a href="../data_sources/dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="../data_sources/ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="../data_sources/js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="../data_sources/server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="../api/add_row.html">Add rows</a>
</li>
<li>
<a href="../api/multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="../api/multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="../api/highlight.html">Highlighting rows and columns</a>
</li>
<li>
<a href="../api/row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="../api/select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="../api/select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="../api/form.html">Form inputs</a>
</li>
<li>
<a href="../api/counter_columns.html">Index column</a>
</li>
<li>
<a href="../api/show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="../api/api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="../api/tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="../api/regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./index.html">Ajax</a></h3>
<ul class="toc active">
<li>
<a href="./simple.html">Ajax data source (arrays)</a>
</li>
<li class="active">
<a href="./objects.html">Ajax data source (objects)</a>
</li>
<li>
<a href="./deep.html">Nested object data (objects)</a>
</li>
<li>
<a href="./objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="./orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="./null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="./custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="./custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="./defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../server_side/index.html">Server-side</a></h3>
<ul class="toc">
<li>
<a href="../server_side/simple.html">Server-side processing</a>
</li>
<li>
<a href="../server_side/custom_vars.html">Custom HTTP variables</a>
</li>
<li>
<a href="../server_side/post.html">POST data</a>
</li>
<li>
<a href="../server_side/ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="../server_side/object_data.html">Object data source</a>
</li>
<li>
<a href="../server_side/row_details.html">Row details</a>
</li>
<li>
<a href="../server_side/select_rows.html">Row selection</a>
</li>
<li>
<a href="../server_side/jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="../server_side/defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="../server_side/pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="../plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="../plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

View File

@ -1,26 +1,19 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<title>DataTables example - Nested object data (arrays)</title>
<link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"> <title>DataTables example - Nested object data (arrays)</title>
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"><link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<style type="text/css" class="init"> <style type="text/css" class="init">
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <script type="text/javascript" language="javascript" class="init">
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() { $(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
"ajax": "data/objects_subarrays.txt", "ajax": "data/objects_subarrays.txt",
@ -35,80 +28,56 @@ $(document).ready(function() {
} ); } );
} ); } );
</script> </script>
</head> </head>
<body class="dt-example"> <body class="dt-example ">
<div class="container"> <div class="container">
<section> <section>
<h1>DataTables example <span>Nested object data (arrays)</span></h1> <h1>DataTables example <span>Nested object data (arrays)</span></h1>
<div class="info"> <div class="info">
<p>The information read from an Ajax data source can be arbitrarily complex, but still be displayed by DataTables through the <a href= <p>The information read from an Ajax data source can be arbitrarily complex, but still be displayed by DataTables through the <a href="//datatables.net/reference/option/columns.data"><code class="option" title="DataTables initialisation option">columns.data</code></a> option, which is particularly useful for working with JSON feeds in an already defined format.</p>
"//datatables.net/reference/option/columns.data"><code class="option" title="DataTables initialisation option">columns.data</code></a> option, which is
particularly useful for working with JSON feeds in an already defined format.</p> <p>The <a href="//datatables.net/reference/option/columns.data"><code class="option" title="DataTables initialisation option">columns.data</code></a> option has the ability to read information not only from objects, but also from arrays using the same dotted object syntax as for objects. In addition to this, when working with an array data source <a href="//datatables.net/reference/option/columns.data"><code class="option" title="DataTables initialisation option">columns.data</code></a> can process the data to combine and display the data in simple forms (more complex forms can be defined by using <a href="//datatables.net/reference/option/columns.data"><code class="option" title="DataTables initialisation option">columns.data</code></a> as a function).</p>
<p>The <a href="//datatables.net/reference/option/columns.data"><code class="option" title="DataTables initialisation option">columns.data</code></a> option has
the ability to read information not only from objects, but also from arrays using the same dotted object syntax as for objects. In addition to this, when working <p>This example shows two different aspects of using <a href="//datatables.net/reference/option/columns.data"><code class="option" title="DataTables initialisation option">columns.data</code></a> to read arrays:</p>
with an array data source <a href="//datatables.net/reference/option/columns.data"><code class="option" title=
"DataTables initialisation option">columns.data</code></a> can process the data to combine and display the data in simple forms (more complex forms can be defined <ul class="markdown">
by using <a href="//datatables.net/reference/option/columns.data"><code class="option" title="DataTables initialisation option">columns.data</code></a> as a <li>The <em>Name</em> column is sourced from an array of two elements (first and last name), which are automatically concatenated together. This is done by using array bracket syntax, with the characters between the brackets being used as the glue between elements (e.g. <code>name[, ]</code>).</li>
function).</p> <li>The <em>Position</em>, <em>Start date</em> and <em>Salary</em> columns are read directly from array elements using dotted object notation (e.g. <code>hr.0</code>). Note that the order in which the data can be used in the columns does not have to match the order in which it is defined in the data source. The structure of the row's data source in this example is:</li>
<p>This example shows two different aspects of using <a href="//datatables.net/reference/option/columns.data"><code class="option" title= </ul>
"DataTables initialisation option">columns.data</code></a> to read arrays:</p>
<ul class="markdown"> <pre><code class="multiline">{
<li>The <em>Name</em> column is sourced from an array of two elements (first and last name), which are automatically concatenated together. This is done by "name": [
using array bracket syntax, with the characters between the brackets being used as the glue between elements (e.g. <code>name[, ]</code>).</li> "Nixon",
<li>The <em>Position</em>, <em>Start date</em> and <em>Salary</em> columns are read directly from array elements using dotted object notation (e.g. "Tiger"
<code>hr.0</code>). Note that the order in which the data can be used in the columns does not have to match the order in which it is defined in the data ],
source. The structure of the row's data source in this example is:</li> "hr": [
</ul> "System Architect",
<pre> "$3,120",
<code class="multiline">{ "2011/04/25"
"name": [ ],
"Nixon", "office": "Edinburgh",
"Tiger" "extn": "5421"
],
"hr": [
"System Architect",
"$3,120",
"2011/04/25"
],
"office": "Edinburgh",
"extn": "5421"
} }
</code> </code></pre>
</pre>
</div> </div>
<table id="example" class="display" cellspacing="0" width="100%">
<thead>
<tr> <table id="example" class="display" cellspacing="0" width="100%"><thead><tr><th>Name</th><th>Position</th><th>Office</th><th>Extn.</th><th>Start date</th><th>Salary</th></tr></thead><tfoot><tr><th>Name</th><th>Position</th><th>Office</th><th>Extn.</th><th>Start date</th><th>Salary</th></tr></tfoot></table>
<th>Name</th>
<th>Position</th> <ul class="tabs">
<th>Office</th> <li class="active">Javascript</li>
<th>Extn.</th> <li>HTML</li>
<th>Start date</th> <li>CSS</li>
<th>Salary</th> <li>Ajax</li>
</tr> <li>Server-side script</li>
</thead> </ul>
<tfoot>
<tr> <div class="tabs">
<th>Name</th> <div class="js">
<th>Position</th> <p>The Javascript shown below is used to initialise the table shown in this example:</p>
<th>Office</th> <code class="multiline language-js">$(document).ready(function() {
<th>Extn.</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
&quot;ajax&quot;: &quot;data/objects_subarrays.txt&quot;, &quot;ajax&quot;: &quot;data/objects_subarrays.txt&quot;,
&quot;columns&quot;: [ &quot;columns&quot;: [
@ -121,366 +90,153 @@ $(document).ready(function() {
] ]
} ); } );
} );</code> } );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul> <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<li> <ul><li><a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a></li><li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li></ul>
<a href="//code.jquery.com/jquery-1.12.3.js">//code.jquery.com/jquery-1.12.3.js</a> </div>
</li> <div class="table">
<li> <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
<a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a> </div>
</li> <div class="css">
</ul> <div>
</div> <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 additional CSS used is shown below:</p>
<div class="table"> <code class="multiline language-css"></code>
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p> </div>
</div>
<div class="css"> <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<div> <ul><li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li></ul>
<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 </div>
additional CSS used is shown below:</p><code class="multiline language-css"></code> <div class="ajax">
<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 loaded.</p>
</div>
<div class="php">
<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 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables documentation</a>.</p>
</div> </div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a>
</li>
</ul>
</div> </div>
<div class="ajax"> </section>
<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
loaded.</p>
</div> </div>
<div class="php">
<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 <section>
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables <div class="footer">
documentation</a>.</p> <div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group"><h3><a href="../basic_init/index.html
">Basic initialisation</a></h3><ul class="toc"><li><a href="../basic_init/zero_configuration.html
">Zero configuration</a></li><li><a href="../basic_init/filter_only.html
">Feature enable / disable</a></li><li><a href="../basic_init/table_sorting.html
">Default ordering (sorting)</a></li><li><a href="../basic_init/multi_col_sort.html
">Multi-column ordering</a></li><li><a href="../basic_init/multiple_tables.html
">Multiple tables</a></li><li><a href="../basic_init/hidden_columns.html
">Hidden columns</a></li><li><a href="../basic_init/complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="../basic_init/dom.html
">DOM positioning</a></li><li><a href="../basic_init/flexible_width.html
">Flexible table width</a></li><li><a href="../basic_init/state_save.html
">State saving</a></li><li><a href="../basic_init/alt_pagination.html
">Alternative pagination</a></li><li><a href="../basic_init/scroll_y.html
">Scroll - vertical</a></li><li><a href="../basic_init/scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="../basic_init/scroll_x.html
">Scroll - horizontal</a></li><li><a href="../basic_init/scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="../basic_init/comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="../basic_init/language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="../advanced_init/index.html
">Advanced initialisation</a></h3><ul class="toc"><li><a href="../advanced_init/events_live.html
">DOM / jQuery events</a></li><li><a href="../advanced_init/dt_events.html
">DataTables events</a></li><li><a href="../advanced_init/column_render.html
">Column rendering</a></li><li><a href="../advanced_init/length_menu.html
">Page length options</a></li><li><a href="../advanced_init/dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="../advanced_init/complex_header.html
">Complex headers with column visibility</a></li><li><a href="../advanced_init/object_dom_read.html
">Read HTML to data objects</a></li><li><a href="../advanced_init/html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="../advanced_init/html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="../advanced_init/language_file.html
">Language file</a></li><li><a href="../advanced_init/defaults.html
">Setting defaults</a></li><li><a href="../advanced_init/row_callback.html
">Row created callback</a></li><li><a href="../advanced_init/row_grouping.html
">Row grouping</a></li><li><a href="../advanced_init/footer_callback.html
">Footer callback</a></li><li><a href="../advanced_init/dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="../advanced_init/sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="../styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="../styling/display.html
">Base style</a></li><li><a href="../styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="../styling/cell-border.html
">Base style - cell borders</a></li><li><a href="../styling/compact.html
">Base style - compact</a></li><li><a href="../styling/hover.html
">Base style - hover</a></li><li><a href="../styling/order-column.html
">Base style - order-column</a></li><li><a href="../styling/row-border.html
">Base style - row borders</a></li><li><a href="../styling/stripe.html
">Base style - stripe</a></li><li><a href="../styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="../styling/foundation.html
">Foundation</a></li><li><a href="../styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="../styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="../styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="../styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="../styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="../data_sources/index.html
">Data sources</a></h3><ul class="toc"><li><a href="../data_sources/dom.html
">HTML (DOM) sourced data</a></li><li><a href="../data_sources/ajax.html
">Ajax sourced data</a></li><li><a href="../data_sources/js_array.html
">Javascript sourced data</a></li><li><a href="../data_sources/server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="../api/index.html
">API</a></h3><ul class="toc"><li><a href="../api/add_row.html
">Add rows</a></li><li><a href="../api/multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="../api/multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="../api/highlight.html
">Highlighting rows and columns</a></li><li><a href="../api/row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="../api/select_row.html
">Row selection (multiple rows)</a></li><li><a href="../api/select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="../api/form.html
">Form inputs</a></li><li><a href="../api/counter_columns.html
">Index column</a></li><li><a href="../api/show_hide.html
">Show / hide columns dynamically</a></li><li><a href="../api/api_in_init.html
">Using API in callbacks</a></li><li><a href="../api/tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="../api/regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="./index.html
">Ajax</a></h3><ul class="toc active"><li><a href="./simple.html
">Ajax data source (arrays)</a></li><li><a href="./objects.html
">Ajax data source (objects)</a></li><li><a href="./deep.html
">Nested object data (objects)</a></li><li class="active"><a href="./objects_subarrays.html
">Nested object data (arrays)</a></li><li><a href="./orthogonal-data.html
">Orthogonal data</a></li><li><a href="./null_data_source.html
">Generated content for a column</a></li><li><a href="./custom_data_property.html
">Custom data source property</a></li><li><a href="./custom_data_flat.html
">Flat array data source</a></li><li><a href="./defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="../server_side/index.html
">Server-side</a></h3><ul class="toc"><li><a href="../server_side/simple.html
">Server-side processing</a></li><li><a href="../server_side/custom_vars.html
">Custom HTTP variables</a></li><li><a href="../server_side/post.html
">POST data</a></li><li><a href="../server_side/ids.html
">Automatic addition of row ID attributes</a></li><li><a href="../server_side/object_data.html
">Object data source</a></li><li><a href="../server_side/row_details.html
">Row details</a></li><li><a href="../server_side/select_rows.html
">Row selection</a></li><li><a href="../server_side/jsonp.html
">JSONP data source for remote domains</a></li><li><a href="../server_side/defer_loading.html
">Deferred loading of data</a></li><li><a href="../server_side/pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="../plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="../plug-ins/api.html
">API plug-in methods</a></li><li><a href="../plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="../plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="../plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="../plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div> </div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="../basic_init/index.html">Basic initialisation</a></h3>
<ul class="toc">
<li>
<a href="../basic_init/zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="../basic_init/filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="../basic_init/table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="../basic_init/multi_col_sort.html">Multi-column ordering</a>
</li>
<li>
<a href="../basic_init/multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="../basic_init/hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="../basic_init/complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="../basic_init/dom.html">DOM positioning</a>
</li>
<li>
<a href="../basic_init/flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="../basic_init/state_save.html">State saving</a>
</li>
<li>
<a href="../basic_init/alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="../basic_init/scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="../basic_init/scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="../basic_init/scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="../basic_init/scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="../basic_init/comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="../basic_init/language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../advanced_init/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="../advanced_init/events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="../advanced_init/dt_events.html">DataTables events</a>
</li>
<li>
<a href="../advanced_init/column_render.html">Column rendering</a>
</li>
<li>
<a href="../advanced_init/length_menu.html">Page length options</a>
</li>
<li>
<a href="../advanced_init/dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="../advanced_init/complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="../advanced_init/object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="../advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="../advanced_init/language_file.html">Language file</a>
</li>
<li>
<a href="../advanced_init/defaults.html">Setting defaults</a>
</li>
<li>
<a href="../advanced_init/row_callback.html">Row created callback</a>
</li>
<li>
<a href="../advanced_init/row_grouping.html">Row grouping</a>
</li>
<li>
<a href="../advanced_init/footer_callback.html">Footer callback</a>
</li>
<li>
<a href="../advanced_init/dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="../advanced_init/sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/display.html">Base style</a>
</li>
<li>
<a href="../styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="../styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="../styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="../styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="../styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="../styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="../styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="../styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="../styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../data_sources/index.html">Data sources</a></h3>
<ul class="toc">
<li>
<a href="../data_sources/dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="../data_sources/ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="../data_sources/js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="../data_sources/server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="../api/add_row.html">Add rows</a>
</li>
<li>
<a href="../api/multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="../api/multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="../api/highlight.html">Highlighting rows and columns</a>
</li>
<li>
<a href="../api/row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="../api/select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="../api/select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="../api/form.html">Form inputs</a>
</li>
<li>
<a href="../api/counter_columns.html">Index column</a>
</li>
<li>
<a href="../api/show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="../api/api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="../api/tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="../api/regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./index.html">Ajax</a></h3>
<ul class="toc active">
<li>
<a href="./simple.html">Ajax data source (arrays)</a>
</li>
<li>
<a href="./objects.html">Ajax data source (objects)</a>
</li>
<li>
<a href="./deep.html">Nested object data (objects)</a>
</li>
<li class="active">
<a href="./objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="./orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="./null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="./custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="./custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="./defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../server_side/index.html">Server-side</a></h3>
<ul class="toc">
<li>
<a href="../server_side/simple.html">Server-side processing</a>
</li>
<li>
<a href="../server_side/custom_vars.html">Custom HTTP variables</a>
</li>
<li>
<a href="../server_side/post.html">POST data</a>
</li>
<li>
<a href="../server_side/ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="../server_side/object_data.html">Object data source</a>
</li>
<li>
<a href="../server_side/row_details.html">Row details</a>
</li>
<li>
<a href="../server_side/select_rows.html">Row selection</a>
</li>
<li>
<a href="../server_side/jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="../server_side/defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="../server_side/pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="../plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="../plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

View File

@ -1,26 +1,19 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<title>DataTables example - Orthogonal data</title>
<link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"> <title>DataTables example - Orthogonal data</title>
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"><link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<style type="text/css" class="init"> <style type="text/css" class="init">
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <script type="text/javascript" language="javascript" class="init">
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() { $(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
ajax: "data/orthogonal.txt", ajax: "data/orthogonal.txt",
@ -38,68 +31,49 @@ $(document).ready(function() {
} ); } );
} ); } );
</script> </script>
</head> </head>
<body class="dt-example"> <body class="dt-example ">
<div class="container"> <div class="container">
<section> <section>
<h1>DataTables example <span>Orthogonal data</span></h1> <h1>DataTables example <span>Orthogonal data</span></h1>
<div class="info"> <div class="info">
<p>To try and make life easy, by default, DataTables expects arrays to be used as the data source for rows in the table. However, this isn't always useful, and you <p>To try and make life easy, by default, DataTables expects arrays to be used as the data source for rows in the table. However, this isn't always useful, and you may wish to have DataTables use objects as the data source for each row (i.e. each row has its data described by an object) as this can make working with the data much more understandable, particularly if you are using the API and you don't need to keep track of array indexes.</p>
may wish to have DataTables use objects as the data source for each row (i.e. each row has its data described by an object) as this can make working with the data
much more understandable, particularly if you are using the API and you don't need to keep track of array indexes.</p> <p>This can be done quite simply by using the <a href="//datatables.net/reference/option/columns.data"><code class="option" title="DataTables initialisation option">columns.data</code></a> option which you use to tell DataTables which property to use from the data source object for each column.</p>
<p>This can be done quite simply by using the <a href="//datatables.net/reference/option/columns.data"><code class="option" title=
"DataTables initialisation option">columns.data</code></a> option which you use to tell DataTables which property to use from the data source object for each <p>In this example the Ajax source returns an array of objects, which DataTables uses to display the table. The structure of the row's data source in this example is:</p>
column.</p>
<p>In this example the Ajax source returns an array of objects, which DataTables uses to display the table. The structure of the row's data source in this example <pre><code class="multiline">{
is:</p> "name": "Tiger Nixon",
<pre> "position": "System Architect",
<code class="multiline">{ "salary": "$3,120",
"name": "Tiger Nixon", "start_date": {
"position": "System Architect", "display": "Mon 25th Apr 11",
"salary": "$3,120", "timestamp": "1303682400"
"start_date": { },
"display": "Mon 25th Apr 11", "office": "Edinburgh",
"timestamp": "1303682400" "extn": "5421"
},
"office": "Edinburgh",
"extn": "5421"
} }
</code> </code></pre>
</pre>
</div> </div>
<table id="example" class="display" cellspacing="0" width="100%">
<thead>
<tr> <table id="example" class="display" cellspacing="0" width="100%"><thead><tr><th>Name</th><th>Position</th><th>Office</th><th>Extn.</th><th>Start date</th><th>Salary</th></tr></thead><tfoot><tr><th>Name</th><th>Position</th><th>Office</th><th>Extn.</th><th>Start date</th><th>Salary</th></tr></tfoot></table>
<th>Name</th>
<th>Position</th> <ul class="tabs">
<th>Office</th> <li class="active">Javascript</li>
<th>Extn.</th> <li>HTML</li>
<th>Start date</th> <li>CSS</li>
<th>Salary</th> <li>Ajax</li>
</tr> <li>Server-side script</li>
</thead> </ul>
<tfoot>
<tr> <div class="tabs">
<th>Name</th> <div class="js">
<th>Position</th> <p>The Javascript shown below is used to initialise the table shown in this example:</p>
<th>Office</th> <code class="multiline language-js">$(document).ready(function() {
<th>Extn.</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
ajax: &quot;data/orthogonal.txt&quot;, ajax: &quot;data/orthogonal.txt&quot;,
columns: [ columns: [
@ -115,366 +89,153 @@ $(document).ready(function() {
] ]
} ); } );
} );</code> } );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul> <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<li> <ul><li><a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a></li><li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li></ul>
<a href="//code.jquery.com/jquery-1.12.3.js">//code.jquery.com/jquery-1.12.3.js</a> </div>
</li> <div class="table">
<li> <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
<a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a> </div>
</li> <div class="css">
</ul> <div>
</div> <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 additional CSS used is shown below:</p>
<div class="table"> <code class="multiline language-css"></code>
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p> </div>
</div>
<div class="css"> <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<div> <ul><li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li></ul>
<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 </div>
additional CSS used is shown below:</p><code class="multiline language-css"></code> <div class="ajax">
<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 loaded.</p>
</div>
<div class="php">
<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 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables documentation</a>.</p>
</div> </div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a>
</li>
</ul>
</div> </div>
<div class="ajax"> </section>
<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
loaded.</p>
</div> </div>
<div class="php">
<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 <section>
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables <div class="footer">
documentation</a>.</p> <div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group"><h3><a href="../basic_init/index.html
">Basic initialisation</a></h3><ul class="toc"><li><a href="../basic_init/zero_configuration.html
">Zero configuration</a></li><li><a href="../basic_init/filter_only.html
">Feature enable / disable</a></li><li><a href="../basic_init/table_sorting.html
">Default ordering (sorting)</a></li><li><a href="../basic_init/multi_col_sort.html
">Multi-column ordering</a></li><li><a href="../basic_init/multiple_tables.html
">Multiple tables</a></li><li><a href="../basic_init/hidden_columns.html
">Hidden columns</a></li><li><a href="../basic_init/complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="../basic_init/dom.html
">DOM positioning</a></li><li><a href="../basic_init/flexible_width.html
">Flexible table width</a></li><li><a href="../basic_init/state_save.html
">State saving</a></li><li><a href="../basic_init/alt_pagination.html
">Alternative pagination</a></li><li><a href="../basic_init/scroll_y.html
">Scroll - vertical</a></li><li><a href="../basic_init/scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="../basic_init/scroll_x.html
">Scroll - horizontal</a></li><li><a href="../basic_init/scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="../basic_init/comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="../basic_init/language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="../advanced_init/index.html
">Advanced initialisation</a></h3><ul class="toc"><li><a href="../advanced_init/events_live.html
">DOM / jQuery events</a></li><li><a href="../advanced_init/dt_events.html
">DataTables events</a></li><li><a href="../advanced_init/column_render.html
">Column rendering</a></li><li><a href="../advanced_init/length_menu.html
">Page length options</a></li><li><a href="../advanced_init/dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="../advanced_init/complex_header.html
">Complex headers with column visibility</a></li><li><a href="../advanced_init/object_dom_read.html
">Read HTML to data objects</a></li><li><a href="../advanced_init/html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="../advanced_init/html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="../advanced_init/language_file.html
">Language file</a></li><li><a href="../advanced_init/defaults.html
">Setting defaults</a></li><li><a href="../advanced_init/row_callback.html
">Row created callback</a></li><li><a href="../advanced_init/row_grouping.html
">Row grouping</a></li><li><a href="../advanced_init/footer_callback.html
">Footer callback</a></li><li><a href="../advanced_init/dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="../advanced_init/sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="../styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="../styling/display.html
">Base style</a></li><li><a href="../styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="../styling/cell-border.html
">Base style - cell borders</a></li><li><a href="../styling/compact.html
">Base style - compact</a></li><li><a href="../styling/hover.html
">Base style - hover</a></li><li><a href="../styling/order-column.html
">Base style - order-column</a></li><li><a href="../styling/row-border.html
">Base style - row borders</a></li><li><a href="../styling/stripe.html
">Base style - stripe</a></li><li><a href="../styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="../styling/foundation.html
">Foundation</a></li><li><a href="../styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="../styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="../styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="../styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="../styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="../data_sources/index.html
">Data sources</a></h3><ul class="toc"><li><a href="../data_sources/dom.html
">HTML (DOM) sourced data</a></li><li><a href="../data_sources/ajax.html
">Ajax sourced data</a></li><li><a href="../data_sources/js_array.html
">Javascript sourced data</a></li><li><a href="../data_sources/server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="../api/index.html
">API</a></h3><ul class="toc"><li><a href="../api/add_row.html
">Add rows</a></li><li><a href="../api/multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="../api/multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="../api/highlight.html
">Highlighting rows and columns</a></li><li><a href="../api/row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="../api/select_row.html
">Row selection (multiple rows)</a></li><li><a href="../api/select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="../api/form.html
">Form inputs</a></li><li><a href="../api/counter_columns.html
">Index column</a></li><li><a href="../api/show_hide.html
">Show / hide columns dynamically</a></li><li><a href="../api/api_in_init.html
">Using API in callbacks</a></li><li><a href="../api/tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="../api/regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="./index.html
">Ajax</a></h3><ul class="toc active"><li><a href="./simple.html
">Ajax data source (arrays)</a></li><li><a href="./objects.html
">Ajax data source (objects)</a></li><li><a href="./deep.html
">Nested object data (objects)</a></li><li><a href="./objects_subarrays.html
">Nested object data (arrays)</a></li><li class="active"><a href="./orthogonal-data.html
">Orthogonal data</a></li><li><a href="./null_data_source.html
">Generated content for a column</a></li><li><a href="./custom_data_property.html
">Custom data source property</a></li><li><a href="./custom_data_flat.html
">Flat array data source</a></li><li><a href="./defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="../server_side/index.html
">Server-side</a></h3><ul class="toc"><li><a href="../server_side/simple.html
">Server-side processing</a></li><li><a href="../server_side/custom_vars.html
">Custom HTTP variables</a></li><li><a href="../server_side/post.html
">POST data</a></li><li><a href="../server_side/ids.html
">Automatic addition of row ID attributes</a></li><li><a href="../server_side/object_data.html
">Object data source</a></li><li><a href="../server_side/row_details.html
">Row details</a></li><li><a href="../server_side/select_rows.html
">Row selection</a></li><li><a href="../server_side/jsonp.html
">JSONP data source for remote domains</a></li><li><a href="../server_side/defer_loading.html
">Deferred loading of data</a></li><li><a href="../server_side/pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="../plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="../plug-ins/api.html
">API plug-in methods</a></li><li><a href="../plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="../plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="../plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="../plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div> </div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="../basic_init/index.html">Basic initialisation</a></h3>
<ul class="toc">
<li>
<a href="../basic_init/zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="../basic_init/filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="../basic_init/table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="../basic_init/multi_col_sort.html">Multi-column ordering</a>
</li>
<li>
<a href="../basic_init/multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="../basic_init/hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="../basic_init/complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="../basic_init/dom.html">DOM positioning</a>
</li>
<li>
<a href="../basic_init/flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="../basic_init/state_save.html">State saving</a>
</li>
<li>
<a href="../basic_init/alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="../basic_init/scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="../basic_init/scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="../basic_init/scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="../basic_init/scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="../basic_init/comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="../basic_init/language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../advanced_init/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="../advanced_init/events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="../advanced_init/dt_events.html">DataTables events</a>
</li>
<li>
<a href="../advanced_init/column_render.html">Column rendering</a>
</li>
<li>
<a href="../advanced_init/length_menu.html">Page length options</a>
</li>
<li>
<a href="../advanced_init/dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="../advanced_init/complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="../advanced_init/object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="../advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="../advanced_init/language_file.html">Language file</a>
</li>
<li>
<a href="../advanced_init/defaults.html">Setting defaults</a>
</li>
<li>
<a href="../advanced_init/row_callback.html">Row created callback</a>
</li>
<li>
<a href="../advanced_init/row_grouping.html">Row grouping</a>
</li>
<li>
<a href="../advanced_init/footer_callback.html">Footer callback</a>
</li>
<li>
<a href="../advanced_init/dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="../advanced_init/sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/display.html">Base style</a>
</li>
<li>
<a href="../styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="../styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="../styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="../styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="../styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="../styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="../styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="../styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="../styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../data_sources/index.html">Data sources</a></h3>
<ul class="toc">
<li>
<a href="../data_sources/dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="../data_sources/ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="../data_sources/js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="../data_sources/server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="../api/add_row.html">Add rows</a>
</li>
<li>
<a href="../api/multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="../api/multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="../api/highlight.html">Highlighting rows and columns</a>
</li>
<li>
<a href="../api/row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="../api/select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="../api/select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="../api/form.html">Form inputs</a>
</li>
<li>
<a href="../api/counter_columns.html">Index column</a>
</li>
<li>
<a href="../api/show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="../api/api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="../api/tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="../api/regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./index.html">Ajax</a></h3>
<ul class="toc active">
<li>
<a href="./simple.html">Ajax data source (arrays)</a>
</li>
<li>
<a href="./objects.html">Ajax data source (objects)</a>
</li>
<li>
<a href="./deep.html">Nested object data (objects)</a>
</li>
<li>
<a href="./objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li class="active">
<a href="./orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="./null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="./custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="./custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="./defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../server_side/index.html">Server-side</a></h3>
<ul class="toc">
<li>
<a href="../server_side/simple.html">Server-side processing</a>
</li>
<li>
<a href="../server_side/custom_vars.html">Custom HTTP variables</a>
</li>
<li>
<a href="../server_side/post.html">POST data</a>
</li>
<li>
<a href="../server_side/ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="../server_side/object_data.html">Object data source</a>
</li>
<li>
<a href="../server_side/row_details.html">Row details</a>
</li>
<li>
<a href="../server_side/select_rows.html">Row selection</a>
</li>
<li>
<a href="../server_side/jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="../server_side/defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="../server_side/pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="../plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="../plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

View File

@ -1,459 +1,220 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<title>DataTables example - Ajax data source (arrays)</title>
<link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"> <title>DataTables example - Ajax data source (arrays)</title>
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"><link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<style type="text/css" class="init"> <style type="text/css" class="init">
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <script type="text/javascript" language="javascript" class="init">
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() { $(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
"ajax": "data/arrays.txt" "ajax": "data/arrays.txt"
} ); } );
} ); } );
</script> </script>
</head> </head>
<body class="dt-example"> <body class="dt-example ">
<div class="container"> <div class="container">
<section> <section>
<h1>DataTables example <span>Ajax data source (arrays)</span></h1> <h1>DataTables example <span>Ajax data source (arrays)</span></h1>
<div class="info"> <div class="info">
<p>DataTables has the ability to read data from virtually any JSON data source that can be obtained by Ajax. This can be done, in its most simple form, by setting <p>DataTables has the ability to read data from virtually any JSON data source that can be obtained by Ajax. This can be done, in its most simple form, by setting the <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> option to the address of the JSON data source.</p>
the <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> option to the address of the
JSON data source.</p> <p>The <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> option also allows for more advanced configuration such as altering how the Ajax request is made. See the <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> documentation or the other Ajax examples for DataTables for further information.</p>
<p>The <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> option also allows for more
advanced configuration such as altering how the Ajax request is made. See the <a href="//datatables.net/reference/option/ajax"><code class="option" title= <p>By default DataTables will assume that an array data source is to be used and will read the information to be displayed in each column from the row's array using the column index, making working with arrays very simple (note that this can be changed, or objects used may using the <a href="//datatables.net/reference/option/columns.data"><code class="option" title="DataTables initialisation option">columns.data</code></a> option, shown in other examples).</p>
"DataTables initialisation option">ajax</code></a> documentation or the other Ajax examples for DataTables for further information.</p>
<p>By default DataTables will assume that an array data source is to be used and will read the information to be displayed in each column from the row's array <p>The example below shows DataTables loading data for a table from arrays as the data source, where the structure of the row's data source in this example is:</p>
using the column index, making working with arrays very simple (note that this can be changed, or objects used may using the <a href=
"//datatables.net/reference/option/columns.data"><code class="option" title="DataTables initialisation option">columns.data</code></a> option, shown in other <pre><code class="multiline">[
examples).</p> "Tiger Nixon",
<p>The example below shows DataTables loading data for a table from arrays as the data source, where the structure of the row's data source in this example is:</p> "System Architect",
<pre> "Edinburgh",
<code class="multiline">[ "5421",
"Tiger Nixon", "2011/04/25",
"System Architect", "$3,120"
"Edinburgh",
"5421",
"2011/04/25",
"$3,120"
] ]
</code> </code></pre>
</pre>
<p>For more details on loading a DataTable with Ajax data, please refer to the <a href="https://datatables.net/manual/ajax">Ajax section of the manual</a>.</p> <p>For more details on loading a DataTable with Ajax data, please refer to the <a href="https://datatables.net/manual/ajax">Ajax section of the manual</a>.</p>
</div>
<table id="example" class="display" cellspacing="0" width="100%"> </div>
<thead>
<tr>
<th>Name</th> <table id="example" class="display" cellspacing="0" width="100%"><thead><tr><th>Name</th><th>Position</th><th>Office</th><th>Extn.</th><th>Start date</th><th>Salary</th></tr></thead><tfoot><tr><th>Name</th><th>Position</th><th>Office</th><th>Extn.</th><th>Start date</th><th>Salary</th></tr></tfoot></table>
<th>Position</th>
<th>Office</th> <ul class="tabs">
<th>Extn.</th> <li class="active">Javascript</li>
<th>Start date</th> <li>HTML</li>
<th>Salary</th> <li>CSS</li>
</tr> <li>Ajax</li>
</thead> <li>Server-side script</li>
<tfoot> </ul>
<tr>
<th>Name</th> <div class="tabs">
<th>Position</th> <div class="js">
<th>Office</th> <p>The Javascript shown below is used to initialise the table shown in this example:</p>
<th>Extn.</th> <code class="multiline language-js">$(document).ready(function() {
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
&quot;ajax&quot;: &quot;data/arrays.txt&quot; &quot;ajax&quot;: &quot;data/arrays.txt&quot;
} ); } );
} );</code> } );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul> <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<li> <ul><li><a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a></li><li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li></ul>
<a href="//code.jquery.com/jquery-1.12.3.js">//code.jquery.com/jquery-1.12.3.js</a> </div>
</li> <div class="table">
<li> <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
<a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a> </div>
</li> <div class="css">
</ul> <div>
</div> <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 additional CSS used is shown below:</p>
<div class="table"> <code class="multiline language-css"></code>
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p> </div>
</div>
<div class="css"> <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<div> <ul><li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li></ul>
<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 </div>
additional CSS used is shown below:</p><code class="multiline language-css"></code> <div class="ajax">
<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 loaded.</p>
</div>
<div class="php">
<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 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables documentation</a>.</p>
</div> </div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a>
</li>
</ul>
</div> </div>
<div class="ajax"> </section>
<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
loaded.</p>
</div> </div>
<div class="php">
<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 <section>
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables <div class="footer">
documentation</a>.</p> <div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group"><h3><a href="../basic_init/index.html
">Basic initialisation</a></h3><ul class="toc"><li><a href="../basic_init/zero_configuration.html
">Zero configuration</a></li><li><a href="../basic_init/filter_only.html
">Feature enable / disable</a></li><li><a href="../basic_init/table_sorting.html
">Default ordering (sorting)</a></li><li><a href="../basic_init/multi_col_sort.html
">Multi-column ordering</a></li><li><a href="../basic_init/multiple_tables.html
">Multiple tables</a></li><li><a href="../basic_init/hidden_columns.html
">Hidden columns</a></li><li><a href="../basic_init/complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="../basic_init/dom.html
">DOM positioning</a></li><li><a href="../basic_init/flexible_width.html
">Flexible table width</a></li><li><a href="../basic_init/state_save.html
">State saving</a></li><li><a href="../basic_init/alt_pagination.html
">Alternative pagination</a></li><li><a href="../basic_init/scroll_y.html
">Scroll - vertical</a></li><li><a href="../basic_init/scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="../basic_init/scroll_x.html
">Scroll - horizontal</a></li><li><a href="../basic_init/scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="../basic_init/comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="../basic_init/language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="../advanced_init/index.html
">Advanced initialisation</a></h3><ul class="toc"><li><a href="../advanced_init/events_live.html
">DOM / jQuery events</a></li><li><a href="../advanced_init/dt_events.html
">DataTables events</a></li><li><a href="../advanced_init/column_render.html
">Column rendering</a></li><li><a href="../advanced_init/length_menu.html
">Page length options</a></li><li><a href="../advanced_init/dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="../advanced_init/complex_header.html
">Complex headers with column visibility</a></li><li><a href="../advanced_init/object_dom_read.html
">Read HTML to data objects</a></li><li><a href="../advanced_init/html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="../advanced_init/html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="../advanced_init/language_file.html
">Language file</a></li><li><a href="../advanced_init/defaults.html
">Setting defaults</a></li><li><a href="../advanced_init/row_callback.html
">Row created callback</a></li><li><a href="../advanced_init/row_grouping.html
">Row grouping</a></li><li><a href="../advanced_init/footer_callback.html
">Footer callback</a></li><li><a href="../advanced_init/dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="../advanced_init/sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="../styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="../styling/display.html
">Base style</a></li><li><a href="../styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="../styling/cell-border.html
">Base style - cell borders</a></li><li><a href="../styling/compact.html
">Base style - compact</a></li><li><a href="../styling/hover.html
">Base style - hover</a></li><li><a href="../styling/order-column.html
">Base style - order-column</a></li><li><a href="../styling/row-border.html
">Base style - row borders</a></li><li><a href="../styling/stripe.html
">Base style - stripe</a></li><li><a href="../styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="../styling/foundation.html
">Foundation</a></li><li><a href="../styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="../styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="../styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="../styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="../styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="../data_sources/index.html
">Data sources</a></h3><ul class="toc"><li><a href="../data_sources/dom.html
">HTML (DOM) sourced data</a></li><li><a href="../data_sources/ajax.html
">Ajax sourced data</a></li><li><a href="../data_sources/js_array.html
">Javascript sourced data</a></li><li><a href="../data_sources/server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="../api/index.html
">API</a></h3><ul class="toc"><li><a href="../api/add_row.html
">Add rows</a></li><li><a href="../api/multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="../api/multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="../api/highlight.html
">Highlighting rows and columns</a></li><li><a href="../api/row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="../api/select_row.html
">Row selection (multiple rows)</a></li><li><a href="../api/select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="../api/form.html
">Form inputs</a></li><li><a href="../api/counter_columns.html
">Index column</a></li><li><a href="../api/show_hide.html
">Show / hide columns dynamically</a></li><li><a href="../api/api_in_init.html
">Using API in callbacks</a></li><li><a href="../api/tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="../api/regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="./index.html
">Ajax</a></h3><ul class="toc active"><li class="active"><a href="./simple.html
">Ajax data source (arrays)</a></li><li><a href="./objects.html
">Ajax data source (objects)</a></li><li><a href="./deep.html
">Nested object data (objects)</a></li><li><a href="./objects_subarrays.html
">Nested object data (arrays)</a></li><li><a href="./orthogonal-data.html
">Orthogonal data</a></li><li><a href="./null_data_source.html
">Generated content for a column</a></li><li><a href="./custom_data_property.html
">Custom data source property</a></li><li><a href="./custom_data_flat.html
">Flat array data source</a></li><li><a href="./defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="../server_side/index.html
">Server-side</a></h3><ul class="toc"><li><a href="../server_side/simple.html
">Server-side processing</a></li><li><a href="../server_side/custom_vars.html
">Custom HTTP variables</a></li><li><a href="../server_side/post.html
">POST data</a></li><li><a href="../server_side/ids.html
">Automatic addition of row ID attributes</a></li><li><a href="../server_side/object_data.html
">Object data source</a></li><li><a href="../server_side/row_details.html
">Row details</a></li><li><a href="../server_side/select_rows.html
">Row selection</a></li><li><a href="../server_side/jsonp.html
">JSONP data source for remote domains</a></li><li><a href="../server_side/defer_loading.html
">Deferred loading of data</a></li><li><a href="../server_side/pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="../plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="../plug-ins/api.html
">API plug-in methods</a></li><li><a href="../plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="../plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="../plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="../plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div> </div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="../basic_init/index.html">Basic initialisation</a></h3>
<ul class="toc">
<li>
<a href="../basic_init/zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="../basic_init/filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="../basic_init/table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="../basic_init/multi_col_sort.html">Multi-column ordering</a>
</li>
<li>
<a href="../basic_init/multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="../basic_init/hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="../basic_init/complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="../basic_init/dom.html">DOM positioning</a>
</li>
<li>
<a href="../basic_init/flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="../basic_init/state_save.html">State saving</a>
</li>
<li>
<a href="../basic_init/alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="../basic_init/scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="../basic_init/scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="../basic_init/scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="../basic_init/scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="../basic_init/comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="../basic_init/language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../advanced_init/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="../advanced_init/events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="../advanced_init/dt_events.html">DataTables events</a>
</li>
<li>
<a href="../advanced_init/column_render.html">Column rendering</a>
</li>
<li>
<a href="../advanced_init/length_menu.html">Page length options</a>
</li>
<li>
<a href="../advanced_init/dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="../advanced_init/complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="../advanced_init/object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="../advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="../advanced_init/language_file.html">Language file</a>
</li>
<li>
<a href="../advanced_init/defaults.html">Setting defaults</a>
</li>
<li>
<a href="../advanced_init/row_callback.html">Row created callback</a>
</li>
<li>
<a href="../advanced_init/row_grouping.html">Row grouping</a>
</li>
<li>
<a href="../advanced_init/footer_callback.html">Footer callback</a>
</li>
<li>
<a href="../advanced_init/dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="../advanced_init/sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/display.html">Base style</a>
</li>
<li>
<a href="../styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="../styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="../styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="../styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="../styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="../styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="../styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="../styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="../styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../data_sources/index.html">Data sources</a></h3>
<ul class="toc">
<li>
<a href="../data_sources/dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="../data_sources/ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="../data_sources/js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="../data_sources/server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="../api/add_row.html">Add rows</a>
</li>
<li>
<a href="../api/multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="../api/multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="../api/highlight.html">Highlighting rows and columns</a>
</li>
<li>
<a href="../api/row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="../api/select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="../api/select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="../api/form.html">Form inputs</a>
</li>
<li>
<a href="../api/counter_columns.html">Index column</a>
</li>
<li>
<a href="../api/show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="../api/api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="../api/tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="../api/regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./index.html">Ajax</a></h3>
<ul class="toc active">
<li class="active">
<a href="./simple.html">Ajax data source (arrays)</a>
</li>
<li>
<a href="./objects.html">Ajax data source (objects)</a>
</li>
<li>
<a href="./deep.html">Nested object data (objects)</a>
</li>
<li>
<a href="./objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="./orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="./null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="./custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="./custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="./defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../server_side/index.html">Server-side</a></h3>
<ul class="toc">
<li>
<a href="../server_side/simple.html">Server-side processing</a>
</li>
<li>
<a href="../server_side/custom_vars.html">Custom HTTP variables</a>
</li>
<li>
<a href="../server_side/post.html">POST data</a>
</li>
<li>
<a href="../server_side/ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="../server_side/object_data.html">Object data source</a>
</li>
<li>
<a href="../server_side/row_details.html">Row details</a>
</li>
<li>
<a href="../server_side/select_rows.html">Row selection</a>
</li>
<li>
<a href="../server_side/jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="../server_side/defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="../server_side/pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="../plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="../plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

View File

@ -1,26 +1,19 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<title>DataTables example - Add rows</title>
<link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"> <title>DataTables example - Add rows</title>
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"><link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<style type="text/css" class="init"> <style type="text/css" class="init">
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <script type="text/javascript" language="javascript" class="init">
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() { $(document).ready(function() {
var t = $('#example').DataTable(); var t = $('#example').DataTable();
@ -43,55 +36,38 @@ $(document).ready(function() {
} ); } );
</script> </script>
</head> </head>
<body class="dt-example"> <body class="dt-example ">
<div class="container"> <div class="container">
<section> <section>
<h1>DataTables example <span>Add rows</span></h1> <h1>DataTables example <span>Add rows</span></h1>
<div class="info"> <div class="info">
<p>New rows can be added to a DataTable very easily using the <a href="//datatables.net/reference/api/row.add()"><code class="api" title= <p>New rows can be added to a DataTable very easily using the <a href="//datatables.net/reference/api/row.add()"><code class="api" title="DataTables API method">row.add()</code></a> API method. Simply call the API function with the data that is to be used for the new row (be it an array or object). Multiple rows can be added using the <a href="//datatables.net/reference/api/rows.add()"><code class="api" title="DataTables API method">rows.add()</code></a> method (note the plural). Data can be likewise be updated with the <a href="//datatables.net/reference/api/row().data()"><code class="api" title="DataTables API method">row().data()</code></a> and <a href="//datatables.net/reference/api/row().remove()"><code class="api" title="DataTables API method">row().remove()</code></a> methods.</p>
"DataTables API method">row.add()</code></a> API method. Simply call the API function with the data that is to be used for the new row (be it an array or object).
Multiple rows can be added using the <a href="//datatables.net/reference/api/rows.add()"><code class="api" title="DataTables API method">rows.add()</code></a> <p>Note that in order to see the new row in the table you must call the <a href="//datatables.net/reference/api/draw()"><code class="api" title="DataTables API method">draw()</code></a> method, which is easily done through the chaining that the DataTables API makes use of.</p>
method (note the plural). Data can be likewise be updated with the <a href="//datatables.net/reference/api/row().data()"><code class="api" title=
"DataTables API method">row().data()</code></a> and <a href="//datatables.net/reference/api/row().remove()"><code class="api" title= <p>This example shows a single row being added each time the button below is clicked upon.</p>
"DataTables API method">row().remove()</code></a> methods.</p>
<p>Note that in order to see the new row in the table you must call the <a href="//datatables.net/reference/api/draw()"><code class="api" title= <p>The <a href="https://editor.datatables.net/">Editor extension</a> adds full table editing controls, including creating, editing and deleting rows, to a DataTable.</p>
"DataTables API method">draw()</code></a> method, which is easily done through the chaining that the DataTables API makes use of.</p>
<p>This example shows a single row being added each time the button below is clicked upon.</p> </div>
<p>The <a href="https://editor.datatables.net/">Editor extension</a> adds full table editing controls, including creating, editing and deleting rows, to a
DataTable.</p> <button id="addRow">Add new row</button>
</div><button id="addRow">Add new row</button> <table id="example" class="display" cellspacing="0" width="100%"><thead><tr><th>Column 1</th><th>Column 2</th><th>Column 3</th><th>Column 4</th><th>Column 5</th></tr></thead><tfoot><tr><th>Column 1</th><th>Column 2</th><th>Column 3</th><th>Column 4</th><th>Column 5</th></tr></tfoot><tbody></tbody></table>
<table id="example" class="display" cellspacing="0" width="100%">
<thead> <ul class="tabs">
<tr> <li class="active">Javascript</li>
<th>Column 1</th> <li>HTML</li>
<th>Column 2</th> <li>CSS</li>
<th>Column 3</th> <li>Ajax</li>
<th>Column 4</th> <li>Server-side script</li>
<th>Column 5</th> </ul>
</tr>
</thead> <div class="tabs">
<tfoot> <div class="js">
<tr> <p>The Javascript shown below is used to initialise the table shown in this example:</p>
<th>Column 1</th> <code class="multiline language-js">$(document).ready(function() {
<th>Column 2</th>
<th>Column 3</th>
<th>Column 4</th>
<th>Column 5</th>
</tr>
</tfoot>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
var t = $('#example').DataTable(); var t = $('#example').DataTable();
var counter = 1; var counter = 1;
@ -110,366 +86,153 @@ $(document).ready(function() {
// Automatically add a first row of data // Automatically add a first row of data
$('#addRow').click(); $('#addRow').click();
} );</code> } );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul> <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<li> <ul><li><a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a></li><li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li></ul>
<a href="//code.jquery.com/jquery-1.12.3.js">//code.jquery.com/jquery-1.12.3.js</a> </div>
</li> <div class="table">
<li> <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
<a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a> </div>
</li> <div class="css">
</ul> <div>
</div> <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 additional CSS used is shown below:</p>
<div class="table"> <code class="multiline language-css"></code>
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p> </div>
</div>
<div class="css"> <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<div> <ul><li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li></ul>
<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 </div>
additional CSS used is shown below:</p><code class="multiline language-css"></code> <div class="ajax">
<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 loaded.</p>
</div>
<div class="php">
<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 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables documentation</a>.</p>
</div> </div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a>
</li>
</ul>
</div> </div>
<div class="ajax"> </section>
<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
loaded.</p>
</div> </div>
<div class="php">
<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 <section>
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables <div class="footer">
documentation</a>.</p> <div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group"><h3><a href="../basic_init/index.html
">Basic initialisation</a></h3><ul class="toc"><li><a href="../basic_init/zero_configuration.html
">Zero configuration</a></li><li><a href="../basic_init/filter_only.html
">Feature enable / disable</a></li><li><a href="../basic_init/table_sorting.html
">Default ordering (sorting)</a></li><li><a href="../basic_init/multi_col_sort.html
">Multi-column ordering</a></li><li><a href="../basic_init/multiple_tables.html
">Multiple tables</a></li><li><a href="../basic_init/hidden_columns.html
">Hidden columns</a></li><li><a href="../basic_init/complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="../basic_init/dom.html
">DOM positioning</a></li><li><a href="../basic_init/flexible_width.html
">Flexible table width</a></li><li><a href="../basic_init/state_save.html
">State saving</a></li><li><a href="../basic_init/alt_pagination.html
">Alternative pagination</a></li><li><a href="../basic_init/scroll_y.html
">Scroll - vertical</a></li><li><a href="../basic_init/scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="../basic_init/scroll_x.html
">Scroll - horizontal</a></li><li><a href="../basic_init/scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="../basic_init/comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="../basic_init/language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="../advanced_init/index.html
">Advanced initialisation</a></h3><ul class="toc"><li><a href="../advanced_init/events_live.html
">DOM / jQuery events</a></li><li><a href="../advanced_init/dt_events.html
">DataTables events</a></li><li><a href="../advanced_init/column_render.html
">Column rendering</a></li><li><a href="../advanced_init/length_menu.html
">Page length options</a></li><li><a href="../advanced_init/dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="../advanced_init/complex_header.html
">Complex headers with column visibility</a></li><li><a href="../advanced_init/object_dom_read.html
">Read HTML to data objects</a></li><li><a href="../advanced_init/html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="../advanced_init/html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="../advanced_init/language_file.html
">Language file</a></li><li><a href="../advanced_init/defaults.html
">Setting defaults</a></li><li><a href="../advanced_init/row_callback.html
">Row created callback</a></li><li><a href="../advanced_init/row_grouping.html
">Row grouping</a></li><li><a href="../advanced_init/footer_callback.html
">Footer callback</a></li><li><a href="../advanced_init/dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="../advanced_init/sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="../styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="../styling/display.html
">Base style</a></li><li><a href="../styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="../styling/cell-border.html
">Base style - cell borders</a></li><li><a href="../styling/compact.html
">Base style - compact</a></li><li><a href="../styling/hover.html
">Base style - hover</a></li><li><a href="../styling/order-column.html
">Base style - order-column</a></li><li><a href="../styling/row-border.html
">Base style - row borders</a></li><li><a href="../styling/stripe.html
">Base style - stripe</a></li><li><a href="../styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="../styling/foundation.html
">Foundation</a></li><li><a href="../styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="../styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="../styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="../styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="../styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="../data_sources/index.html
">Data sources</a></h3><ul class="toc"><li><a href="../data_sources/dom.html
">HTML (DOM) sourced data</a></li><li><a href="../data_sources/ajax.html
">Ajax sourced data</a></li><li><a href="../data_sources/js_array.html
">Javascript sourced data</a></li><li><a href="../data_sources/server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="./index.html
">API</a></h3><ul class="toc active"><li class="active"><a href="./add_row.html
">Add rows</a></li><li><a href="./multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="./multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="./highlight.html
">Highlighting rows and columns</a></li><li><a href="./row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="./select_row.html
">Row selection (multiple rows)</a></li><li><a href="./select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="./form.html
">Form inputs</a></li><li><a href="./counter_columns.html
">Index column</a></li><li><a href="./show_hide.html
">Show / hide columns dynamically</a></li><li><a href="./api_in_init.html
">Using API in callbacks</a></li><li><a href="./tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="./regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="../ajax/index.html
">Ajax</a></h3><ul class="toc"><li><a href="../ajax/simple.html
">Ajax data source (arrays)</a></li><li><a href="../ajax/objects.html
">Ajax data source (objects)</a></li><li><a href="../ajax/deep.html
">Nested object data (objects)</a></li><li><a href="../ajax/objects_subarrays.html
">Nested object data (arrays)</a></li><li><a href="../ajax/orthogonal-data.html
">Orthogonal data</a></li><li><a href="../ajax/null_data_source.html
">Generated content for a column</a></li><li><a href="../ajax/custom_data_property.html
">Custom data source property</a></li><li><a href="../ajax/custom_data_flat.html
">Flat array data source</a></li><li><a href="../ajax/defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="../server_side/index.html
">Server-side</a></h3><ul class="toc"><li><a href="../server_side/simple.html
">Server-side processing</a></li><li><a href="../server_side/custom_vars.html
">Custom HTTP variables</a></li><li><a href="../server_side/post.html
">POST data</a></li><li><a href="../server_side/ids.html
">Automatic addition of row ID attributes</a></li><li><a href="../server_side/object_data.html
">Object data source</a></li><li><a href="../server_side/row_details.html
">Row details</a></li><li><a href="../server_side/select_rows.html
">Row selection</a></li><li><a href="../server_side/jsonp.html
">JSONP data source for remote domains</a></li><li><a href="../server_side/defer_loading.html
">Deferred loading of data</a></li><li><a href="../server_side/pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="../plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="../plug-ins/api.html
">API plug-in methods</a></li><li><a href="../plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="../plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="../plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="../plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div> </div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="../basic_init/index.html">Basic initialisation</a></h3>
<ul class="toc">
<li>
<a href="../basic_init/zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="../basic_init/filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="../basic_init/table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="../basic_init/multi_col_sort.html">Multi-column ordering</a>
</li>
<li>
<a href="../basic_init/multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="../basic_init/hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="../basic_init/complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="../basic_init/dom.html">DOM positioning</a>
</li>
<li>
<a href="../basic_init/flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="../basic_init/state_save.html">State saving</a>
</li>
<li>
<a href="../basic_init/alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="../basic_init/scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="../basic_init/scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="../basic_init/scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="../basic_init/scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="../basic_init/comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="../basic_init/language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../advanced_init/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="../advanced_init/events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="../advanced_init/dt_events.html">DataTables events</a>
</li>
<li>
<a href="../advanced_init/column_render.html">Column rendering</a>
</li>
<li>
<a href="../advanced_init/length_menu.html">Page length options</a>
</li>
<li>
<a href="../advanced_init/dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="../advanced_init/complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="../advanced_init/object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="../advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="../advanced_init/language_file.html">Language file</a>
</li>
<li>
<a href="../advanced_init/defaults.html">Setting defaults</a>
</li>
<li>
<a href="../advanced_init/row_callback.html">Row created callback</a>
</li>
<li>
<a href="../advanced_init/row_grouping.html">Row grouping</a>
</li>
<li>
<a href="../advanced_init/footer_callback.html">Footer callback</a>
</li>
<li>
<a href="../advanced_init/dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="../advanced_init/sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/display.html">Base style</a>
</li>
<li>
<a href="../styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="../styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="../styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="../styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="../styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="../styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="../styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="../styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="../styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../data_sources/index.html">Data sources</a></h3>
<ul class="toc">
<li>
<a href="../data_sources/dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="../data_sources/ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="../data_sources/js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="../data_sources/server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./index.html">API</a></h3>
<ul class="toc active">
<li class="active">
<a href="./add_row.html">Add rows</a>
</li>
<li>
<a href="./multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="./multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="./highlight.html">Highlighting rows and columns</a>
</li>
<li>
<a href="./row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="./select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="./select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="./form.html">Form inputs</a>
</li>
<li>
<a href="./counter_columns.html">Index column</a>
</li>
<li>
<a href="./show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="./api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="./tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="./regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../ajax/index.html">Ajax</a></h3>
<ul class="toc">
<li>
<a href="../ajax/simple.html">Ajax data source (arrays)</a>
</li>
<li>
<a href="../ajax/objects.html">Ajax data source (objects)</a>
</li>
<li>
<a href="../ajax/deep.html">Nested object data (objects)</a>
</li>
<li>
<a href="../ajax/objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="../ajax/orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="../ajax/null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="../ajax/custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="../ajax/custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="../ajax/defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../server_side/index.html">Server-side</a></h3>
<ul class="toc">
<li>
<a href="../server_side/simple.html">Server-side processing</a>
</li>
<li>
<a href="../server_side/custom_vars.html">Custom HTTP variables</a>
</li>
<li>
<a href="../server_side/post.html">POST data</a>
</li>
<li>
<a href="../server_side/ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="../server_side/object_data.html">Object data source</a>
</li>
<li>
<a href="../server_side/row_details.html">Row details</a>
</li>
<li>
<a href="../server_side/select_rows.html">Row selection</a>
</li>
<li>
<a href="../server_side/jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="../server_side/defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="../server_side/pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="../plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="../plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,88 +1,60 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <title>DataTables examples - API</title>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"> </head>
</script> <body class="dt-example">
<script type="text/javascript" language="javascript" src="../resources/demo.js"> <div class="container">
</script> <section>
<title>DataTables examples - API</title> <h1>DataTables example <span>API</span></h1>
</head> <div class="info">
<body class="dt-example"> <p>The real power of DataTables can be exploited through the use of the API that it presents. The DataTables API is designed to be simple, consistent and easy to use. The examples in this section show how the API may be used.</p>
<div class="container">
</div>
</section>
</div>
<section> <section>
<h1>DataTables example <span>API</span></h1> <div class="footer">
<div class="info"> <div class="gradient"></div>
<p>The real power of DataTables can be exploited through the use of the API that it presents. The DataTables API is designed to be simple, consistent and easy to <div class="liner">
use. The examples in this section show how the API may be used.</p> <div class="toc">
</div> <div class="toc-group"><h3><a href="./index.html
</section> ">API</a></h3><ul class="toc"><li><a href="./add_row.html
</div> ">Add rows</a></li><li><a href="./multi_filter.html
<section> ">Individual column searching (text inputs)</a></li><li><a href="./multi_filter_select.html
<div class="footer"> ">Individual column searching (select inputs)</a></li><li><a href="./highlight.html
<div class="gradient"></div> ">Highlighting rows and columns</a></li><li><a href="./row_details.html
<div class="liner"> ">Child rows (show extra / detailed information)</a></li><li><a href="./select_row.html
<div class="toc"> ">Row selection (multiple rows)</a></li><li><a href="./select_single_row.html
<div class="toc-group"> ">Row selection and deletion (single row)</a></li><li><a href="./form.html
<h3><a href="./index.html">API</a></h3> ">Form inputs</a></li><li><a href="./counter_columns.html
<ul class="toc"> ">Index column</a></li><li><a href="./show_hide.html
<li> ">Show / hide columns dynamically</a></li><li><a href="./api_in_init.html
<a href="./add_row.html">Add rows</a> ">Using API in callbacks</a></li><li><a href="./tabs_and_scrolling.html
</li> ">Scrolling and Bootstrap tabs</a></li><li><a href="./regex.html
<li> ">Search API (regular expressions)</a></li></ul></div>
<a href="./multi_filter.html">Individual column searching (text inputs)</a> </div>
</li>
<li> <div class="epilogue">
<a href="./multi_filter_select.html">Individual column searching (select inputs)</a> <p>
</li> Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
<li> Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
<a href="./highlight.html">Highlighting rows and columns</a> </p>
</li>
<li> <p class="copyright">
<a href="./row_details.html">Child rows (show extra / detailed information)</a> DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
</li> DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
<li> </p>
<a href="./select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="./select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="./form.html">Form inputs</a>
</li>
<li>
<a href="./counter_columns.html">Index column</a>
</li>
<li>
<a href="./show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="./api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="./tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="./regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div> </div>
</div> </div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div> </div>
</div> </section>
</section> </body>
</body>
</html> </html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,15 +1,15 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<title>DataTables example - Child rows (show extra / detailed information)</title>
<link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"> <title>DataTables example - Child rows (show extra / detailed information)</title>
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"><link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<style type="text/css" class="init"> <style type="text/css" class="init">
td.details-control { td.details-control {
background: url('../resources/details_open.png') no-repeat center center; background: url('../resources/details_open.png') no-repeat center center;
cursor: pointer; cursor: pointer;
@ -18,17 +18,10 @@ tr.shown td.details-control {
background: url('../resources/details_close.png') no-repeat center center; background: url('../resources/details_close.png') no-repeat center center;
} }
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <script type="text/javascript" language="javascript" class="init">
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
/* Formatting function for row details - modify as you need */ /* Formatting function for row details - modify as you need */
function format ( d ) { function format ( d ) {
@ -86,52 +79,34 @@ $(document).ready(function() {
} ); } );
</script> </script>
</head> </head>
<body class="dt-example"> <body class="dt-example ">
<div class="container"> <div class="container">
<section> <section>
<h1>DataTables example <span>Child rows (show extra / detailed information)</span></h1> <h1>DataTables example <span>Child rows (show extra / detailed information)</span></h1>
<div class="info"> <div class="info">
<p>The DataTables API has a number of methods available for attaching child rows to a <em>parent</em> row in the DataTable. This can be used to show additional <p>The DataTables API has a number of methods available for attaching child rows to a <em>parent</em> row in the DataTable. This can be used to show additional information about a row, useful for cases where you wish to convey more information about a row than there is space for in the host table.</p>
information about a row, useful for cases where you wish to convey more information about a row than there is space for in the host table.</p>
<p>The example below makes use of the <a href="//datatables.net/reference/api/row().child"><code class="api" title="DataTables API method">row().child</code></a> <p>The example below makes use of the <a href="//datatables.net/reference/api/row().child"><code class="api" title="DataTables API method">row().child</code></a> methods to firstly check if a row is already displayed, and if so hide it (<a href="//datatables.net/reference/api/row().child.hide()"><code class="api" title="DataTables API method">row().child.hide()</code></a>), otherwise show it (<a href="//datatables.net/reference/api/row().child.show()"><code class="api" title="DataTables API method">row().child.show()</code></a>). The content of the child row is, in this example, defined by the <code>formatDetails()</code> function, but you would replace that with whatever you wanted to show the content required, possibly including, for example, an Ajax call to the server to obtain the extra information to show.</p>
methods to firstly check if a row is already displayed, and if so hide it (<a href="//datatables.net/reference/api/row().child.hide()"><code class="api" title=
"DataTables API method">row().child.hide()</code></a>), otherwise show it (<a href="//datatables.net/reference/api/row().child.show()"><code class="api" title= </div>
"DataTables API method">row().child.show()</code></a>). The content of the child row is, in this example, defined by the <code>formatDetails()</code> function, but
you would replace that with whatever you wanted to show the content required, possibly including, for example, an Ajax call to the server to obtain the extra
information to show.</p> <table id="example" class="display" cellspacing="0" width="100%"><thead><tr><th></th><th>Name</th><th>Position</th><th>Office</th><th>Salary</th></tr></thead><tfoot><tr><th></th><th>Name</th><th>Position</th><th>Office</th><th>Salary</th></tr></tfoot></table>
</div>
<table id="example" class="display" cellspacing="0" width="100%"> <ul class="tabs">
<thead> <li class="active">Javascript</li>
<tr> <li>HTML</li>
<th></th> <li>CSS</li>
<th>Name</th> <li>Ajax</li>
<th>Position</th> <li>Server-side script</li>
<th>Office</th> </ul>
<th>Salary</th>
</tr> <div class="tabs">
</thead> <div class="js">
<tfoot> <p>The Javascript shown below is used to initialise the table shown in this example:</p>
<tr> <code class="multiline language-js">/* Formatting function for row details - modify as you need */
<th></th>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">/* Formatting function for row details - modify as you need */
function format ( d ) { function format ( d ) {
// `d` is the original data object for the row // `d` is the original data object for the row
return '&lt;table cellpadding=&quot;5&quot; cellspacing=&quot;0&quot; border=&quot;0&quot; style=&quot;padding-left:50px;&quot;&gt;'+ return '&lt;table cellpadding=&quot;5&quot; cellspacing=&quot;0&quot; border=&quot;0&quot; style=&quot;padding-left:50px;&quot;&gt;'+
@ -185,372 +160,159 @@ $(document).ready(function() {
} }
} ); } );
} );</code> } );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul> <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<li> <ul><li><a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a></li><li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li></ul>
<a href="//code.jquery.com/jquery-1.12.3.js">//code.jquery.com/jquery-1.12.3.js</a> </div>
</li> <div class="table">
<li> <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
<a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a> </div>
</li> <div class="css">
</ul> <div>
</div> <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 additional CSS used is shown below:</p>
<div class="table"> <code class="multiline language-css">td.details-control {
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
</div>
<div class="css">
<div>
<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
additional CSS used is shown below:</p><code class="multiline language-css">td.details-control {
background: url('../resources/details_open.png') no-repeat center center; background: url('../resources/details_open.png') no-repeat center center;
cursor: pointer; cursor: pointer;
} }
tr.shown td.details-control { tr.shown td.details-control {
background: url('../resources/details_close.png') no-repeat center center; background: url('../resources/details_close.png') no-repeat center center;
}</code> }</code>
</div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul><li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li></ul>
</div>
<div class="ajax">
<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 loaded.</p>
</div>
<div class="php">
<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 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables documentation</a>.</p>
</div> </div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a>
</li>
</ul>
</div> </div>
<div class="ajax"> </section>
<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
loaded.</p>
</div> </div>
<div class="php">
<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 <section>
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables <div class="footer">
documentation</a>.</p> <div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group"><h3><a href="../basic_init/index.html
">Basic initialisation</a></h3><ul class="toc"><li><a href="../basic_init/zero_configuration.html
">Zero configuration</a></li><li><a href="../basic_init/filter_only.html
">Feature enable / disable</a></li><li><a href="../basic_init/table_sorting.html
">Default ordering (sorting)</a></li><li><a href="../basic_init/multi_col_sort.html
">Multi-column ordering</a></li><li><a href="../basic_init/multiple_tables.html
">Multiple tables</a></li><li><a href="../basic_init/hidden_columns.html
">Hidden columns</a></li><li><a href="../basic_init/complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="../basic_init/dom.html
">DOM positioning</a></li><li><a href="../basic_init/flexible_width.html
">Flexible table width</a></li><li><a href="../basic_init/state_save.html
">State saving</a></li><li><a href="../basic_init/alt_pagination.html
">Alternative pagination</a></li><li><a href="../basic_init/scroll_y.html
">Scroll - vertical</a></li><li><a href="../basic_init/scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="../basic_init/scroll_x.html
">Scroll - horizontal</a></li><li><a href="../basic_init/scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="../basic_init/comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="../basic_init/language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="../advanced_init/index.html
">Advanced initialisation</a></h3><ul class="toc"><li><a href="../advanced_init/events_live.html
">DOM / jQuery events</a></li><li><a href="../advanced_init/dt_events.html
">DataTables events</a></li><li><a href="../advanced_init/column_render.html
">Column rendering</a></li><li><a href="../advanced_init/length_menu.html
">Page length options</a></li><li><a href="../advanced_init/dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="../advanced_init/complex_header.html
">Complex headers with column visibility</a></li><li><a href="../advanced_init/object_dom_read.html
">Read HTML to data objects</a></li><li><a href="../advanced_init/html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="../advanced_init/html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="../advanced_init/language_file.html
">Language file</a></li><li><a href="../advanced_init/defaults.html
">Setting defaults</a></li><li><a href="../advanced_init/row_callback.html
">Row created callback</a></li><li><a href="../advanced_init/row_grouping.html
">Row grouping</a></li><li><a href="../advanced_init/footer_callback.html
">Footer callback</a></li><li><a href="../advanced_init/dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="../advanced_init/sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="../styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="../styling/display.html
">Base style</a></li><li><a href="../styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="../styling/cell-border.html
">Base style - cell borders</a></li><li><a href="../styling/compact.html
">Base style - compact</a></li><li><a href="../styling/hover.html
">Base style - hover</a></li><li><a href="../styling/order-column.html
">Base style - order-column</a></li><li><a href="../styling/row-border.html
">Base style - row borders</a></li><li><a href="../styling/stripe.html
">Base style - stripe</a></li><li><a href="../styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="../styling/foundation.html
">Foundation</a></li><li><a href="../styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="../styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="../styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="../styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="../styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="../data_sources/index.html
">Data sources</a></h3><ul class="toc"><li><a href="../data_sources/dom.html
">HTML (DOM) sourced data</a></li><li><a href="../data_sources/ajax.html
">Ajax sourced data</a></li><li><a href="../data_sources/js_array.html
">Javascript sourced data</a></li><li><a href="../data_sources/server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="./index.html
">API</a></h3><ul class="toc active"><li><a href="./add_row.html
">Add rows</a></li><li><a href="./multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="./multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="./highlight.html
">Highlighting rows and columns</a></li><li class="active"><a href="./row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="./select_row.html
">Row selection (multiple rows)</a></li><li><a href="./select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="./form.html
">Form inputs</a></li><li><a href="./counter_columns.html
">Index column</a></li><li><a href="./show_hide.html
">Show / hide columns dynamically</a></li><li><a href="./api_in_init.html
">Using API in callbacks</a></li><li><a href="./tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="./regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="../ajax/index.html
">Ajax</a></h3><ul class="toc"><li><a href="../ajax/simple.html
">Ajax data source (arrays)</a></li><li><a href="../ajax/objects.html
">Ajax data source (objects)</a></li><li><a href="../ajax/deep.html
">Nested object data (objects)</a></li><li><a href="../ajax/objects_subarrays.html
">Nested object data (arrays)</a></li><li><a href="../ajax/orthogonal-data.html
">Orthogonal data</a></li><li><a href="../ajax/null_data_source.html
">Generated content for a column</a></li><li><a href="../ajax/custom_data_property.html
">Custom data source property</a></li><li><a href="../ajax/custom_data_flat.html
">Flat array data source</a></li><li><a href="../ajax/defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="../server_side/index.html
">Server-side</a></h3><ul class="toc"><li><a href="../server_side/simple.html
">Server-side processing</a></li><li><a href="../server_side/custom_vars.html
">Custom HTTP variables</a></li><li><a href="../server_side/post.html
">POST data</a></li><li><a href="../server_side/ids.html
">Automatic addition of row ID attributes</a></li><li><a href="../server_side/object_data.html
">Object data source</a></li><li><a href="../server_side/row_details.html
">Row details</a></li><li><a href="../server_side/select_rows.html
">Row selection</a></li><li><a href="../server_side/jsonp.html
">JSONP data source for remote domains</a></li><li><a href="../server_side/defer_loading.html
">Deferred loading of data</a></li><li><a href="../server_side/pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="../plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="../plug-ins/api.html
">API plug-in methods</a></li><li><a href="../plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="../plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="../plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="../plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div> </div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="../basic_init/index.html">Basic initialisation</a></h3>
<ul class="toc">
<li>
<a href="../basic_init/zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="../basic_init/filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="../basic_init/table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="../basic_init/multi_col_sort.html">Multi-column ordering</a>
</li>
<li>
<a href="../basic_init/multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="../basic_init/hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="../basic_init/complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="../basic_init/dom.html">DOM positioning</a>
</li>
<li>
<a href="../basic_init/flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="../basic_init/state_save.html">State saving</a>
</li>
<li>
<a href="../basic_init/alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="../basic_init/scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="../basic_init/scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="../basic_init/scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="../basic_init/scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="../basic_init/comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="../basic_init/language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../advanced_init/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="../advanced_init/events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="../advanced_init/dt_events.html">DataTables events</a>
</li>
<li>
<a href="../advanced_init/column_render.html">Column rendering</a>
</li>
<li>
<a href="../advanced_init/length_menu.html">Page length options</a>
</li>
<li>
<a href="../advanced_init/dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="../advanced_init/complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="../advanced_init/object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="../advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="../advanced_init/language_file.html">Language file</a>
</li>
<li>
<a href="../advanced_init/defaults.html">Setting defaults</a>
</li>
<li>
<a href="../advanced_init/row_callback.html">Row created callback</a>
</li>
<li>
<a href="../advanced_init/row_grouping.html">Row grouping</a>
</li>
<li>
<a href="../advanced_init/footer_callback.html">Footer callback</a>
</li>
<li>
<a href="../advanced_init/dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="../advanced_init/sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/display.html">Base style</a>
</li>
<li>
<a href="../styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="../styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="../styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="../styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="../styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="../styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="../styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="../styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="../styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../data_sources/index.html">Data sources</a></h3>
<ul class="toc">
<li>
<a href="../data_sources/dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="../data_sources/ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="../data_sources/js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="../data_sources/server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./index.html">API</a></h3>
<ul class="toc active">
<li>
<a href="./add_row.html">Add rows</a>
</li>
<li>
<a href="./multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="./multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="./highlight.html">Highlighting rows and columns</a>
</li>
<li class="active">
<a href="./row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="./select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="./select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="./form.html">Form inputs</a>
</li>
<li>
<a href="./counter_columns.html">Index column</a>
</li>
<li>
<a href="./show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="./api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="./tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="./regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../ajax/index.html">Ajax</a></h3>
<ul class="toc">
<li>
<a href="../ajax/simple.html">Ajax data source (arrays)</a>
</li>
<li>
<a href="../ajax/objects.html">Ajax data source (objects)</a>
</li>
<li>
<a href="../ajax/deep.html">Nested object data (objects)</a>
</li>
<li>
<a href="../ajax/objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="../ajax/orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="../ajax/null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="../ajax/custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="../ajax/custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="../ajax/defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../server_side/index.html">Server-side</a></h3>
<ul class="toc">
<li>
<a href="../server_side/simple.html">Server-side processing</a>
</li>
<li>
<a href="../server_side/custom_vars.html">Custom HTTP variables</a>
</li>
<li>
<a href="../server_side/post.html">POST data</a>
</li>
<li>
<a href="../server_side/ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="../server_side/object_data.html">Object data source</a>
</li>
<li>
<a href="../server_side/row_details.html">Row details</a>
</li>
<li>
<a href="../server_side/select_rows.html">Row selection</a>
</li>
<li>
<a href="../server_side/jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="../server_side/defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="../server_side/pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="../plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="../plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,31 +1,19 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<title>DataTables example - Scrolling and Bootstrap tabs</title>
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <title>DataTables example - Scrolling and Bootstrap tabs</title>
<link rel="stylesheet" type="text/css" href="../../media/css/dataTables.bootstrap.css">
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"> <link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"><link rel="stylesheet" type="text/css" href="../../media/css/dataTables.bootstrap.css"><link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <style type="text/css" class="init">
<style type="text/css" class="init">
</style>
</style> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script><script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script><script type="text/javascript" language="javascript" src="../../media/js/dataTables.bootstrap.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" class="init">
</script>
<script type="text/javascript" language="javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js">
</script>
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../../media/js/dataTables.bootstrap.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() { $(document).ready(function() {
$('a[data-toggle="tab"]').on( 'shown.bs.tab', function (e) { $('a[data-toggle="tab"]').on( 'shown.bs.tab', function (e) {
@ -44,74 +32,75 @@ $(document).ready(function() {
} ); } );
</script> </script>
</head> </head>
<body class="dt-example dt-example-bootstrap"> <body class="dt-example dt-example-bootstrap">
<div class="container"> <div class="container">
<section> <section>
<h1>DataTables example <span>Scrolling and Bootstrap tabs</span></h1> <h1>DataTables example <span>Scrolling and Bootstrap tabs</span></h1>
<div class="info"> <div class="info">
<p>This example shows how DataTables with scrolling can be used together with <a href="http://getbootstrap.com/javascript/#tabs">Bootstrap tabs</a> (or indeed any <p>This example shows how DataTables with scrolling can be used together with <a href="http://getbootstrap.com/javascript/#tabs">Bootstrap tabs</a> (or indeed any other method whereby the table is in a hidden, <code>display:none</code>, element when it is initialised).</p>
other method whereby the table is in a hidden, <code>display:none</code>, element when it is initialised).</p>
<p>The reason this requires special consideration is that when the DataTable is initialised in a hidden element the browser doesn't have any measurements with <p>The reason this requires special consideration is that when the DataTable is initialised in a hidden element the browser doesn't have any measurements with which to give the DataTable, and this will result in the misalignment of columns when scrolling is enabled.</p>
which to give the DataTable, and this will result in the misalignment of columns when scrolling is enabled.</p>
<p>This misalignment can be corrected by the <a href="//datatables.net/reference/api/columns.adjust()"><code class="api" title= <p>This misalignment can be corrected by the <a href="//datatables.net/reference/api/columns.adjust()"><code class="api" title="DataTables API method">columns.adjust()</code></a> method when the table is made visible (i.e. it has dimensions).</p>
"DataTables API method">columns.adjust()</code></a> method when the table is made visible (i.e. it has dimensions).</p>
<p>This example shows how the Bootstrap <code>shown.bs.tab</code> event can be used to trigger this method call. The visible tables on the page are selected using <p>This example shows how the Bootstrap <code>shown.bs.tab</code> event can be used to trigger this method call. The visible tables on the page are selected using the static <a href="//datatables.net/reference/api/%24.fn.dataTable.tables()"><code class="api" title="DataTables API method">$.fn.dataTable.tables()</code></a> method and running the <a href="//datatables.net/reference/api/columns.adjust()"><code class="api" title="DataTables API method">columns.adjust()</code></a> method on them.</p>
the static <a href="//datatables.net/reference/api/%24.fn.dataTable.tables()"><code class="api" title="DataTables API method">$.fn.dataTable.tables()</code></a>
method and running the <a href="//datatables.net/reference/api/columns.adjust()"><code class="api" title="DataTables API method">columns.adjust()</code></a> method
on them.</p>
</div>
<div>
<ul class="nav nav-tabs" role="tablist">
<li class="active">
<a href="#tab-table1" data-toggle="tab">Table 1</a>
</li>
<li>
<a href="#tab-table2" data-toggle="tab">Table 2</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab-table1">
<table id="myTable1" class="table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Extn.</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
</table>
</div>
<div class="tab-pane" id="tab-table2">
<table id="myTable2" class="table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Extn.</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
</table>
</div>
</div> </div>
</div>
<ul class="tabs">
<li class="active">Javascript</li> <div>
<li>HTML</li> <ul class="nav nav-tabs" role="tablist">
<li>CSS</li> <li class="active"><a href="#tab-table1" data-toggle="tab">Table 1</a></li>
<li>Ajax</li> <li><a href="#tab-table2" data-toggle="tab">Table 2</a></li>
<li>Server-side script</li> </ul>
</ul>
<div class="tabs"> <div class="tab-content">
<div class="js"> <div class="tab-pane active" id="tab-table1">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() { <table id="myTable1" class="table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Extn.</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
</table>
</div>
<div class="tab-pane" id="tab-table2">
<table id="myTable2" class="table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Extn.</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p>
<code class="multiline language-js">$(document).ready(function() {
$('a[data-toggle=&quot;tab&quot;]').on( 'shown.bs.tab', function (e) { $('a[data-toggle=&quot;tab&quot;]').on( 'shown.bs.tab', function (e) {
$.fn.dataTable.tables( {visible: true, api: true} ).columns.adjust(); $.fn.dataTable.tables( {visible: true, api: true} ).columns.adjust();
} ); } );
@ -126,375 +115,153 @@ $(document).ready(function() {
// Apply a search to the second table for the demo // Apply a search to the second table for the demo
$('#myTable2').DataTable().search( 'New York' ).draw(); $('#myTable2').DataTable().search( 'New York' ).draw();
} );</code> } );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul> <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<li> <ul><li><a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a></li><li><a href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js">//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js</a></li><li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li><li><a href="../../media/js/dataTables.bootstrap.js">../../media/js/dataTables.bootstrap.js</a></li></ul>
<a href="//code.jquery.com/jquery-1.12.3.js">//code.jquery.com/jquery-1.12.3.js</a> </div>
</li> <div class="table">
<li> <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
<a href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js">//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js</a> </div>
</li> <div class="css">
<li> <div>
<a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a> <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 additional CSS used is shown below:</p>
</li> <code class="multiline language-css"></code>
<li> </div>
<a href="../../media/js/dataTables.bootstrap.js">../../media/js/dataTables.bootstrap.js</a>
</li> <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
</ul> <ul><li><a href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css</a></li><li><a href="../../media/css/dataTables.bootstrap.css">../../media/css/dataTables.bootstrap.css</a></li></ul>
</div> </div>
<div class="table"> <div class="ajax">
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p> <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 loaded.</p>
</div> </div>
<div class="css"> <div class="php">
<div> <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 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables documentation</a>.</p>
<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
additional CSS used is shown below:</p><code class="multiline language-css"></code>
</div> </div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css</a>
</li>
<li>
<a href="../../media/css/dataTables.bootstrap.css">../../media/css/dataTables.bootstrap.css</a>
</li>
</ul>
</div> </div>
<div class="ajax"> </section>
<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
loaded.</p>
</div> </div>
<div class="php">
<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 <section>
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables <div class="footer">
documentation</a>.</p> <div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group"><h3><a href="../basic_init/index.html
">Basic initialisation</a></h3><ul class="toc"><li><a href="../basic_init/zero_configuration.html
">Zero configuration</a></li><li><a href="../basic_init/filter_only.html
">Feature enable / disable</a></li><li><a href="../basic_init/table_sorting.html
">Default ordering (sorting)</a></li><li><a href="../basic_init/multi_col_sort.html
">Multi-column ordering</a></li><li><a href="../basic_init/multiple_tables.html
">Multiple tables</a></li><li><a href="../basic_init/hidden_columns.html
">Hidden columns</a></li><li><a href="../basic_init/complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="../basic_init/dom.html
">DOM positioning</a></li><li><a href="../basic_init/flexible_width.html
">Flexible table width</a></li><li><a href="../basic_init/state_save.html
">State saving</a></li><li><a href="../basic_init/alt_pagination.html
">Alternative pagination</a></li><li><a href="../basic_init/scroll_y.html
">Scroll - vertical</a></li><li><a href="../basic_init/scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="../basic_init/scroll_x.html
">Scroll - horizontal</a></li><li><a href="../basic_init/scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="../basic_init/comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="../basic_init/language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="../advanced_init/index.html
">Advanced initialisation</a></h3><ul class="toc"><li><a href="../advanced_init/events_live.html
">DOM / jQuery events</a></li><li><a href="../advanced_init/dt_events.html
">DataTables events</a></li><li><a href="../advanced_init/column_render.html
">Column rendering</a></li><li><a href="../advanced_init/length_menu.html
">Page length options</a></li><li><a href="../advanced_init/dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="../advanced_init/complex_header.html
">Complex headers with column visibility</a></li><li><a href="../advanced_init/object_dom_read.html
">Read HTML to data objects</a></li><li><a href="../advanced_init/html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="../advanced_init/html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="../advanced_init/language_file.html
">Language file</a></li><li><a href="../advanced_init/defaults.html
">Setting defaults</a></li><li><a href="../advanced_init/row_callback.html
">Row created callback</a></li><li><a href="../advanced_init/row_grouping.html
">Row grouping</a></li><li><a href="../advanced_init/footer_callback.html
">Footer callback</a></li><li><a href="../advanced_init/dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="../advanced_init/sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="../styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="../styling/display.html
">Base style</a></li><li><a href="../styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="../styling/cell-border.html
">Base style - cell borders</a></li><li><a href="../styling/compact.html
">Base style - compact</a></li><li><a href="../styling/hover.html
">Base style - hover</a></li><li><a href="../styling/order-column.html
">Base style - order-column</a></li><li><a href="../styling/row-border.html
">Base style - row borders</a></li><li><a href="../styling/stripe.html
">Base style - stripe</a></li><li><a href="../styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="../styling/foundation.html
">Foundation</a></li><li><a href="../styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="../styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="../styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="../styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="../styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="../data_sources/index.html
">Data sources</a></h3><ul class="toc"><li><a href="../data_sources/dom.html
">HTML (DOM) sourced data</a></li><li><a href="../data_sources/ajax.html
">Ajax sourced data</a></li><li><a href="../data_sources/js_array.html
">Javascript sourced data</a></li><li><a href="../data_sources/server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="./index.html
">API</a></h3><ul class="toc active"><li><a href="./add_row.html
">Add rows</a></li><li><a href="./multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="./multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="./highlight.html
">Highlighting rows and columns</a></li><li><a href="./row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="./select_row.html
">Row selection (multiple rows)</a></li><li><a href="./select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="./form.html
">Form inputs</a></li><li><a href="./counter_columns.html
">Index column</a></li><li><a href="./show_hide.html
">Show / hide columns dynamically</a></li><li><a href="./api_in_init.html
">Using API in callbacks</a></li><li class="active"><a href="./tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="./regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="../ajax/index.html
">Ajax</a></h3><ul class="toc"><li><a href="../ajax/simple.html
">Ajax data source (arrays)</a></li><li><a href="../ajax/objects.html
">Ajax data source (objects)</a></li><li><a href="../ajax/deep.html
">Nested object data (objects)</a></li><li><a href="../ajax/objects_subarrays.html
">Nested object data (arrays)</a></li><li><a href="../ajax/orthogonal-data.html
">Orthogonal data</a></li><li><a href="../ajax/null_data_source.html
">Generated content for a column</a></li><li><a href="../ajax/custom_data_property.html
">Custom data source property</a></li><li><a href="../ajax/custom_data_flat.html
">Flat array data source</a></li><li><a href="../ajax/defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="../server_side/index.html
">Server-side</a></h3><ul class="toc"><li><a href="../server_side/simple.html
">Server-side processing</a></li><li><a href="../server_side/custom_vars.html
">Custom HTTP variables</a></li><li><a href="../server_side/post.html
">POST data</a></li><li><a href="../server_side/ids.html
">Automatic addition of row ID attributes</a></li><li><a href="../server_side/object_data.html
">Object data source</a></li><li><a href="../server_side/row_details.html
">Row details</a></li><li><a href="../server_side/select_rows.html
">Row selection</a></li><li><a href="../server_side/jsonp.html
">JSONP data source for remote domains</a></li><li><a href="../server_side/defer_loading.html
">Deferred loading of data</a></li><li><a href="../server_side/pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="../plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="../plug-ins/api.html
">API plug-in methods</a></li><li><a href="../plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="../plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="../plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="../plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div> </div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="../basic_init/index.html">Basic initialisation</a></h3>
<ul class="toc">
<li>
<a href="../basic_init/zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="../basic_init/filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="../basic_init/table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="../basic_init/multi_col_sort.html">Multi-column ordering</a>
</li>
<li>
<a href="../basic_init/multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="../basic_init/hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="../basic_init/complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="../basic_init/dom.html">DOM positioning</a>
</li>
<li>
<a href="../basic_init/flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="../basic_init/state_save.html">State saving</a>
</li>
<li>
<a href="../basic_init/alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="../basic_init/scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="../basic_init/scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="../basic_init/scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="../basic_init/scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="../basic_init/comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="../basic_init/language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../advanced_init/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="../advanced_init/events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="../advanced_init/dt_events.html">DataTables events</a>
</li>
<li>
<a href="../advanced_init/column_render.html">Column rendering</a>
</li>
<li>
<a href="../advanced_init/length_menu.html">Page length options</a>
</li>
<li>
<a href="../advanced_init/dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="../advanced_init/complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="../advanced_init/object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="../advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="../advanced_init/language_file.html">Language file</a>
</li>
<li>
<a href="../advanced_init/defaults.html">Setting defaults</a>
</li>
<li>
<a href="../advanced_init/row_callback.html">Row created callback</a>
</li>
<li>
<a href="../advanced_init/row_grouping.html">Row grouping</a>
</li>
<li>
<a href="../advanced_init/footer_callback.html">Footer callback</a>
</li>
<li>
<a href="../advanced_init/dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="../advanced_init/sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/display.html">Base style</a>
</li>
<li>
<a href="../styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="../styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="../styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="../styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="../styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="../styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="../styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="../styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="../styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../data_sources/index.html">Data sources</a></h3>
<ul class="toc">
<li>
<a href="../data_sources/dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="../data_sources/ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="../data_sources/js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="../data_sources/server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./index.html">API</a></h3>
<ul class="toc active">
<li>
<a href="./add_row.html">Add rows</a>
</li>
<li>
<a href="./multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="./multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="./highlight.html">Highlighting rows and columns</a>
</li>
<li>
<a href="./row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="./select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="./select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="./form.html">Form inputs</a>
</li>
<li>
<a href="./counter_columns.html">Index column</a>
</li>
<li>
<a href="./show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="./api_in_init.html">Using API in callbacks</a>
</li>
<li class="active">
<a href="./tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="./regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../ajax/index.html">Ajax</a></h3>
<ul class="toc">
<li>
<a href="../ajax/simple.html">Ajax data source (arrays)</a>
</li>
<li>
<a href="../ajax/objects.html">Ajax data source (objects)</a>
</li>
<li>
<a href="../ajax/deep.html">Nested object data (objects)</a>
</li>
<li>
<a href="../ajax/objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="../ajax/orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="../ajax/null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="../ajax/custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="../ajax/custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="../ajax/defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../server_side/index.html">Server-side</a></h3>
<ul class="toc">
<li>
<a href="../server_side/simple.html">Server-side processing</a>
</li>
<li>
<a href="../server_side/custom_vars.html">Custom HTTP variables</a>
</li>
<li>
<a href="../server_side/post.html">POST data</a>
</li>
<li>
<a href="../server_side/ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="../server_side/object_data.html">Object data source</a>
</li>
<li>
<a href="../server_side/row_details.html">Row details</a>
</li>
<li>
<a href="../server_side/select_rows.html">Row selection</a>
</li>
<li>
<a href="../server_side/jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="../server_side/defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="../server_side/pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="../plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="../plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,100 +1,64 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <title>DataTables examples - Basic initialisation</title>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"> </head>
</script> <body class="dt-example">
<script type="text/javascript" language="javascript" src="../resources/demo.js"> <div class="container">
</script> <section>
<title>DataTables examples - Basic initialisation</title> <h1>DataTables example <span>Basic initialisation</span></h1>
</head> <div class="info">
<body class="dt-example"> <p>DataTables is very simple to use as a jQuery plug-in with a huge range of customisable option. The examples in this section demonstrate basic initialisation of DataTables and how it can be easily customised by passing an object with the options you want.</p>
<div class="container">
</div>
</section>
</div>
<section> <section>
<h1>DataTables example <span>Basic initialisation</span></h1> <div class="footer">
<div class="info"> <div class="gradient"></div>
<p>DataTables is very simple to use as a jQuery plug-in with a huge range of customisable option. The examples in this section demonstrate basic initialisation of <div class="liner">
DataTables and how it can be easily customised by passing an object with the options you want.</p> <div class="toc">
</div> <div class="toc-group"><h3><a href="./index.html
</section> ">Basic initialisation</a></h3><ul class="toc"><li><a href="./zero_configuration.html
</div> ">Zero configuration</a></li><li><a href="./filter_only.html
<section> ">Feature enable / disable</a></li><li><a href="./table_sorting.html
<div class="footer"> ">Default ordering (sorting)</a></li><li><a href="./multi_col_sort.html
<div class="gradient"></div> ">Multi-column ordering</a></li><li><a href="./multiple_tables.html
<div class="liner"> ">Multiple tables</a></li><li><a href="./hidden_columns.html
<div class="toc"> ">Hidden columns</a></li><li><a href="./complex_header.html
<div class="toc-group"> ">Complex headers (rowspan and colspan)</a></li><li><a href="./dom.html
<h3><a href="./index.html">Basic initialisation</a></h3> ">DOM positioning</a></li><li><a href="./flexible_width.html
<ul class="toc"> ">Flexible table width</a></li><li><a href="./state_save.html
<li> ">State saving</a></li><li><a href="./alt_pagination.html
<a href="./zero_configuration.html">Zero configuration</a> ">Alternative pagination</a></li><li><a href="./scroll_y.html
</li> ">Scroll - vertical</a></li><li><a href="./scroll_y_dynamic.html
<li> ">Scroll - vertical, dynamic height</a></li><li><a href="./scroll_x.html
<a href="./filter_only.html">Feature enable / disable</a> ">Scroll - horizontal</a></li><li><a href="./scroll_xy.html
</li> ">Scroll - horizontal and vertical</a></li><li><a href="./comma-decimal.html
<li> ">Language - Comma decimal place</a></li><li><a href="./language.html
<a href="./table_sorting.html">Default ordering (sorting)</a> ">Language options</a></li></ul></div>
</li> </div>
<li>
<a href="./multi_col_sort.html">Multi-column ordering</a> <div class="epilogue">
</li> <p>
<li> Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
<a href="./multiple_tables.html">Multiple tables</a> Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</li> </p>
<li>
<a href="./hidden_columns.html">Hidden columns</a> <p class="copyright">
</li> DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
<li> DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
<a href="./complex_header.html">Complex headers (rowspan and colspan)</a> </p>
</li>
<li>
<a href="./dom.html">DOM positioning</a>
</li>
<li>
<a href="./flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="./state_save.html">State saving</a>
</li>
<li>
<a href="./alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="./scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="./scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="./scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="./scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="./comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="./language.html">Language options</a>
</li>
</ul>
</div> </div>
</div> </div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div> </div>
</div> </section>
</section> </body>
</body>
</html> </html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,614 +1,208 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<title>DataTables example - Multiple tables</title>
<link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"> <title>DataTables example - Multiple tables</title>
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"><link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<style type="text/css" class="init"> <style type="text/css" class="init">
div.dataTables_wrapper { div.dataTables_wrapper {
margin-bottom: 3em; margin-bottom: 3em;
} }
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <script type="text/javascript" language="javascript" class="init">
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() { $(document).ready(function() {
$('table.display').DataTable(); $('table.display').DataTable();
} ); } );
</script> </script>
</head> </head>
<body class="dt-example"> <body class="dt-example ">
<div class="container"> <div class="container">
<section> <section>
<h1>DataTables example <span>Multiple tables</span></h1> <h1>DataTables example <span>Multiple tables</span></h1>
<div class="info"> <div class="info">
<p>Often you might wish to initialise multiple tables with a single statement. This is trivially done by using a jQuery selector which will pick up multiple <p>Often you might wish to initialise multiple tables with a single statement. This is trivially done by using a jQuery selector which will pick up multiple tables.</p>
tables.</p>
<p>The tables are independent for user control (i.e. user controlled paging on one table does not effect the others), but they do share the initialisation <p>The tables are independent for user control (i.e. user controlled paging on one table does not effect the others), but they do share the initialisation parameters given (for example if you specific the Spanish language file, all tables will be shown in Spanish). Additionally, the API can be used to manipulate both together, or independently.</p>
parameters given (for example if you specific the Spanish language file, all tables will be shown in Spanish). Additionally, the API can be used to manipulate both
together, or independently.</p> <p>The example below shows two tables initialised with a single line of code, through the use of the <code>table.display</code> selector (i.e. select all elements which have the class of <code>table.display</code> (which is suitable in this example, you might wish to use a different selector).</p>
<p>The example below shows two tables initialised with a single line of code, through the use of the <code>table.display</code> selector (i.e. select all elements
which have the class of <code>table.display</code> (which is suitable in this example, you might wish to use a different selector).</p> </div>
</div>
<table id="" class="display" cellspacing="0" width="100%">
<thead> <table id="" class="display" cellspacing="0" width="100%"><thead><tr><th>Name</th><th>Position</th><th>Office</th><th>Age</th><th>Salary</th></tr></thead><tfoot><tr><th>Name</th><th>Position</th><th>Office</th><th>Age</th><th>Salary</th></tr></tfoot><tbody><tr><td>Tiger Nixon</td><td>System Architect</td><td>Edinburgh</td><td>61</td><td>$320,800</td></tr><tr><td>Cedric Kelly</td><td>Senior Javascript Developer</td><td>Edinburgh</td><td>22</td><td>$433,060</td></tr><tr><td>Sonya Frost</td><td>Software Engineer</td><td>Edinburgh</td><td>23</td><td>$103,600</td></tr><tr><td>Quinn Flynn</td><td>Support Lead</td><td>Edinburgh</td><td>22</td><td>$342,000</td></tr><tr><td>Dai Rios</td><td>Personnel Lead</td><td>Edinburgh</td><td>35</td><td>$217,500</td></tr><tr><td>Gavin Joyce</td><td>Developer</td><td>Edinburgh</td><td>42</td><td>$92,575</td></tr><tr><td>Martena Mccray</td><td>Post-Sales support</td><td>Edinburgh</td><td>46</td><td>$324,050</td></tr><tr><td>Jennifer Acosta</td><td>Junior Javascript Developer</td><td>Edinburgh</td><td>43</td><td>$75,650</td></tr><tr><td>Shad Decker</td><td>Regional Director</td><td>Edinburgh</td><td>51</td><td>$183,000</td></tr></tbody></table><table id="" class="display" cellspacing="0" width="100%"><thead><tr><th>Name</th><th>Position</th><th>Office</th><th>Age</th><th>Salary</th></tr></thead><tfoot><tr><th>Name</th><th>Position</th><th>Office</th><th>Age</th><th>Salary</th></tr></tfoot><tbody><tr><td>Jena Gaines</td><td>Office Manager</td><td>London</td><td>30</td><td>$90,560</td></tr><tr><td>Haley Kennedy</td><td>Senior Marketing Designer</td><td>London</td><td>43</td><td>$313,500</td></tr><tr><td>Tatyana Fitzpatrick</td><td>Regional Director</td><td>London</td><td>19</td><td>$385,750</td></tr><tr><td>Michael Silva</td><td>Marketing Designer</td><td>London</td><td>66</td><td>$198,500</td></tr><tr><td>Bradley Greer</td><td>Software Engineer</td><td>London</td><td>41</td><td>$132,000</td></tr><tr><td>Angelica Ramos</td><td>Chief Executive Officer (CEO)</td><td>London</td><td>47</td><td>$1,200,000</td></tr><tr><td>Suki Burks</td><td>Developer</td><td>London</td><td>53</td><td>$114,500</td></tr><tr><td>Prescott Bartlett</td><td>Technical Author</td><td>London</td><td>27</td><td>$145,000</td></tr><tr><td>Timothy Mooney</td><td>Office Manager</td><td>London</td><td>37</td><td>$136,200</td></tr><tr><td>Bruno Nash</td><td>Software Engineer</td><td>London</td><td>38</td><td>$163,500</td></tr><tr><td>Hermione Butler</td><td>Regional Director</td><td>London</td><td>47</td><td>$356,250</td></tr><tr><td>Lael Greer</td><td>Systems Administrator</td><td>London</td><td>21</td><td>$103,500</td></tr></tbody></table>
<tr>
<th>Name</th> <ul class="tabs">
<th>Position</th> <li class="active">Javascript</li>
<th>Office</th> <li>HTML</li>
<th>Age</th> <li>CSS</li>
<th>Salary</th> <li>Ajax</li>
</tr> <li>Server-side script</li>
</thead> </ul>
<tfoot>
<tr> <div class="tabs">
<th>Name</th> <div class="js">
<th>Position</th> <p>The Javascript shown below is used to initialise the table shown in this example:</p>
<th>Office</th> <code class="multiline language-js">$(document).ready(function() {
<th>Age</th>
<th>Salary</th>
</tr>
</tfoot>
<tbody>
<tr>
<td>Tiger Nixon</td>
<td>System Architect</td>
<td>Edinburgh</td>
<td>61</td>
<td>$320,800</td>
</tr>
<tr>
<td>Cedric Kelly</td>
<td>Senior Javascript Developer</td>
<td>Edinburgh</td>
<td>22</td>
<td>$433,060</td>
</tr>
<tr>
<td>Sonya Frost</td>
<td>Software Engineer</td>
<td>Edinburgh</td>
<td>23</td>
<td>$103,600</td>
</tr>
<tr>
<td>Quinn Flynn</td>
<td>Support Lead</td>
<td>Edinburgh</td>
<td>22</td>
<td>$342,000</td>
</tr>
<tr>
<td>Dai Rios</td>
<td>Personnel Lead</td>
<td>Edinburgh</td>
<td>35</td>
<td>$217,500</td>
</tr>
<tr>
<td>Gavin Joyce</td>
<td>Developer</td>
<td>Edinburgh</td>
<td>42</td>
<td>$92,575</td>
</tr>
<tr>
<td>Martena Mccray</td>
<td>Post-Sales support</td>
<td>Edinburgh</td>
<td>46</td>
<td>$324,050</td>
</tr>
<tr>
<td>Jennifer Acosta</td>
<td>Junior Javascript Developer</td>
<td>Edinburgh</td>
<td>43</td>
<td>$75,650</td>
</tr>
<tr>
<td>Shad Decker</td>
<td>Regional Director</td>
<td>Edinburgh</td>
<td>51</td>
<td>$183,000</td>
</tr>
</tbody>
</table>
<table id="" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Salary</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Salary</th>
</tr>
</tfoot>
<tbody>
<tr>
<td>Jena Gaines</td>
<td>Office Manager</td>
<td>London</td>
<td>30</td>
<td>$90,560</td>
</tr>
<tr>
<td>Haley Kennedy</td>
<td>Senior Marketing Designer</td>
<td>London</td>
<td>43</td>
<td>$313,500</td>
</tr>
<tr>
<td>Tatyana Fitzpatrick</td>
<td>Regional Director</td>
<td>London</td>
<td>19</td>
<td>$385,750</td>
</tr>
<tr>
<td>Michael Silva</td>
<td>Marketing Designer</td>
<td>London</td>
<td>66</td>
<td>$198,500</td>
</tr>
<tr>
<td>Bradley Greer</td>
<td>Software Engineer</td>
<td>London</td>
<td>41</td>
<td>$132,000</td>
</tr>
<tr>
<td>Angelica Ramos</td>
<td>Chief Executive Officer (CEO)</td>
<td>London</td>
<td>47</td>
<td>$1,200,000</td>
</tr>
<tr>
<td>Suki Burks</td>
<td>Developer</td>
<td>London</td>
<td>53</td>
<td>$114,500</td>
</tr>
<tr>
<td>Prescott Bartlett</td>
<td>Technical Author</td>
<td>London</td>
<td>27</td>
<td>$145,000</td>
</tr>
<tr>
<td>Timothy Mooney</td>
<td>Office Manager</td>
<td>London</td>
<td>37</td>
<td>$136,200</td>
</tr>
<tr>
<td>Bruno Nash</td>
<td>Software Engineer</td>
<td>London</td>
<td>38</td>
<td>$163,500</td>
</tr>
<tr>
<td>Hermione Butler</td>
<td>Regional Director</td>
<td>London</td>
<td>47</td>
<td>$356,250</td>
</tr>
<tr>
<td>Lael Greer</td>
<td>Systems Administrator</td>
<td>London</td>
<td>21</td>
<td>$103,500</td>
</tr>
</tbody>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
$('table.display').DataTable(); $('table.display').DataTable();
} );</code> } );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul> <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<li> <ul><li><a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a></li><li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li></ul>
<a href="//code.jquery.com/jquery-1.12.3.js">//code.jquery.com/jquery-1.12.3.js</a> </div>
</li> <div class="table">
<li> <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
<a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a> </div>
</li> <div class="css">
</ul> <div>
</div> <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 additional CSS used is shown below:</p>
<div class="table"> <code class="multiline language-css">div.dataTables_wrapper {
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
</div>
<div class="css">
<div>
<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
additional CSS used is shown below:</p><code class="multiline language-css">div.dataTables_wrapper {
margin-bottom: 3em; margin-bottom: 3em;
}</code> }</code>
</div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul><li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li></ul>
</div>
<div class="ajax">
<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 loaded.</p>
</div>
<div class="php">
<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 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables documentation</a>.</p>
</div> </div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a>
</li>
</ul>
</div> </div>
<div class="ajax"> </section>
<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
loaded.</p>
</div> </div>
<div class="php">
<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 <section>
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables <div class="footer">
documentation</a>.</p> <div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group"><h3><a href="./index.html
">Basic initialisation</a></h3><ul class="toc active"><li><a href="./zero_configuration.html
">Zero configuration</a></li><li><a href="./filter_only.html
">Feature enable / disable</a></li><li><a href="./table_sorting.html
">Default ordering (sorting)</a></li><li><a href="./multi_col_sort.html
">Multi-column ordering</a></li><li class="active"><a href="./multiple_tables.html
">Multiple tables</a></li><li><a href="./hidden_columns.html
">Hidden columns</a></li><li><a href="./complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="./dom.html
">DOM positioning</a></li><li><a href="./flexible_width.html
">Flexible table width</a></li><li><a href="./state_save.html
">State saving</a></li><li><a href="./alt_pagination.html
">Alternative pagination</a></li><li><a href="./scroll_y.html
">Scroll - vertical</a></li><li><a href="./scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="./scroll_x.html
">Scroll - horizontal</a></li><li><a href="./scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="./comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="./language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="../advanced_init/index.html
">Advanced initialisation</a></h3><ul class="toc"><li><a href="../advanced_init/events_live.html
">DOM / jQuery events</a></li><li><a href="../advanced_init/dt_events.html
">DataTables events</a></li><li><a href="../advanced_init/column_render.html
">Column rendering</a></li><li><a href="../advanced_init/length_menu.html
">Page length options</a></li><li><a href="../advanced_init/dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="../advanced_init/complex_header.html
">Complex headers with column visibility</a></li><li><a href="../advanced_init/object_dom_read.html
">Read HTML to data objects</a></li><li><a href="../advanced_init/html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="../advanced_init/html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="../advanced_init/language_file.html
">Language file</a></li><li><a href="../advanced_init/defaults.html
">Setting defaults</a></li><li><a href="../advanced_init/row_callback.html
">Row created callback</a></li><li><a href="../advanced_init/row_grouping.html
">Row grouping</a></li><li><a href="../advanced_init/footer_callback.html
">Footer callback</a></li><li><a href="../advanced_init/dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="../advanced_init/sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="../styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="../styling/display.html
">Base style</a></li><li><a href="../styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="../styling/cell-border.html
">Base style - cell borders</a></li><li><a href="../styling/compact.html
">Base style - compact</a></li><li><a href="../styling/hover.html
">Base style - hover</a></li><li><a href="../styling/order-column.html
">Base style - order-column</a></li><li><a href="../styling/row-border.html
">Base style - row borders</a></li><li><a href="../styling/stripe.html
">Base style - stripe</a></li><li><a href="../styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="../styling/foundation.html
">Foundation</a></li><li><a href="../styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="../styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="../styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="../styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="../styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="../data_sources/index.html
">Data sources</a></h3><ul class="toc"><li><a href="../data_sources/dom.html
">HTML (DOM) sourced data</a></li><li><a href="../data_sources/ajax.html
">Ajax sourced data</a></li><li><a href="../data_sources/js_array.html
">Javascript sourced data</a></li><li><a href="../data_sources/server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="../api/index.html
">API</a></h3><ul class="toc"><li><a href="../api/add_row.html
">Add rows</a></li><li><a href="../api/multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="../api/multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="../api/highlight.html
">Highlighting rows and columns</a></li><li><a href="../api/row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="../api/select_row.html
">Row selection (multiple rows)</a></li><li><a href="../api/select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="../api/form.html
">Form inputs</a></li><li><a href="../api/counter_columns.html
">Index column</a></li><li><a href="../api/show_hide.html
">Show / hide columns dynamically</a></li><li><a href="../api/api_in_init.html
">Using API in callbacks</a></li><li><a href="../api/tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="../api/regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="../ajax/index.html
">Ajax</a></h3><ul class="toc"><li><a href="../ajax/simple.html
">Ajax data source (arrays)</a></li><li><a href="../ajax/objects.html
">Ajax data source (objects)</a></li><li><a href="../ajax/deep.html
">Nested object data (objects)</a></li><li><a href="../ajax/objects_subarrays.html
">Nested object data (arrays)</a></li><li><a href="../ajax/orthogonal-data.html
">Orthogonal data</a></li><li><a href="../ajax/null_data_source.html
">Generated content for a column</a></li><li><a href="../ajax/custom_data_property.html
">Custom data source property</a></li><li><a href="../ajax/custom_data_flat.html
">Flat array data source</a></li><li><a href="../ajax/defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="../server_side/index.html
">Server-side</a></h3><ul class="toc"><li><a href="../server_side/simple.html
">Server-side processing</a></li><li><a href="../server_side/custom_vars.html
">Custom HTTP variables</a></li><li><a href="../server_side/post.html
">POST data</a></li><li><a href="../server_side/ids.html
">Automatic addition of row ID attributes</a></li><li><a href="../server_side/object_data.html
">Object data source</a></li><li><a href="../server_side/row_details.html
">Row details</a></li><li><a href="../server_side/select_rows.html
">Row selection</a></li><li><a href="../server_side/jsonp.html
">JSONP data source for remote domains</a></li><li><a href="../server_side/defer_loading.html
">Deferred loading of data</a></li><li><a href="../server_side/pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="../plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="../plug-ins/api.html
">API plug-in methods</a></li><li><a href="../plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="../plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="../plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="../plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div> </div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="./index.html">Basic initialisation</a></h3>
<ul class="toc active">
<li>
<a href="./zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="./filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="./table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="./multi_col_sort.html">Multi-column ordering</a>
</li>
<li class="active">
<a href="./multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="./hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="./complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="./dom.html">DOM positioning</a>
</li>
<li>
<a href="./flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="./state_save.html">State saving</a>
</li>
<li>
<a href="./alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="./scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="./scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="./scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="./scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="./comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="./language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../advanced_init/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="../advanced_init/events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="../advanced_init/dt_events.html">DataTables events</a>
</li>
<li>
<a href="../advanced_init/column_render.html">Column rendering</a>
</li>
<li>
<a href="../advanced_init/length_menu.html">Page length options</a>
</li>
<li>
<a href="../advanced_init/dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="../advanced_init/complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="../advanced_init/object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="../advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="../advanced_init/language_file.html">Language file</a>
</li>
<li>
<a href="../advanced_init/defaults.html">Setting defaults</a>
</li>
<li>
<a href="../advanced_init/row_callback.html">Row created callback</a>
</li>
<li>
<a href="../advanced_init/row_grouping.html">Row grouping</a>
</li>
<li>
<a href="../advanced_init/footer_callback.html">Footer callback</a>
</li>
<li>
<a href="../advanced_init/dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="../advanced_init/sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/display.html">Base style</a>
</li>
<li>
<a href="../styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="../styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="../styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="../styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="../styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="../styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="../styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="../styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="../styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../data_sources/index.html">Data sources</a></h3>
<ul class="toc">
<li>
<a href="../data_sources/dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="../data_sources/ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="../data_sources/js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="../data_sources/server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="../api/add_row.html">Add rows</a>
</li>
<li>
<a href="../api/multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="../api/multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="../api/highlight.html">Highlighting rows and columns</a>
</li>
<li>
<a href="../api/row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="../api/select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="../api/select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="../api/form.html">Form inputs</a>
</li>
<li>
<a href="../api/counter_columns.html">Index column</a>
</li>
<li>
<a href="../api/show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="../api/api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="../api/tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="../api/regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../ajax/index.html">Ajax</a></h3>
<ul class="toc">
<li>
<a href="../ajax/simple.html">Ajax data source (arrays)</a>
</li>
<li>
<a href="../ajax/objects.html">Ajax data source (objects)</a>
</li>
<li>
<a href="../ajax/deep.html">Nested object data (objects)</a>
</li>
<li>
<a href="../ajax/objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="../ajax/orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="../ajax/null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="../ajax/custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="../ajax/custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="../ajax/defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../server_side/index.html">Server-side</a></h3>
<ul class="toc">
<li>
<a href="../server_side/simple.html">Server-side processing</a>
</li>
<li>
<a href="../server_side/custom_vars.html">Custom HTTP variables</a>
</li>
<li>
<a href="../server_side/post.html">POST data</a>
</li>
<li>
<a href="../server_side/ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="../server_side/object_data.html">Object data source</a>
</li>
<li>
<a href="../server_side/row_details.html">Row details</a>
</li>
<li>
<a href="../server_side/select_rows.html">Row selection</a>
</li>
<li>
<a href="../server_side/jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="../server_side/defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="../server_side/pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="../plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="../plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,26 +1,19 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<title>DataTables example - Ajax sourced data</title>
<link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"> <title>DataTables example - Ajax sourced data</title>
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"><link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<style type="text/css" class="init"> <style type="text/css" class="init">
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <script type="text/javascript" language="javascript" class="init">
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() { $(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
@ -29,418 +22,187 @@ $(document).ready(function() {
} ); } );
</script> </script>
</head> </head>
<body class="dt-example"> <body class="dt-example ">
<div class="container"> <div class="container">
<section> <section>
<h1>DataTables example <span>Ajax sourced data</span></h1> <h1>DataTables example <span>Ajax sourced data</span></h1>
<div class="info"> <div class="info">
<p>DataTables has the ability to read data from virtually any JSON data source that can be obtained by Ajax. This can be done, in its most simple form, by setting <p>DataTables has the ability to read data from virtually any JSON data source that can be obtained by Ajax. This can be done, in its most simple form, by setting the <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> option to the address of the JSON data source.</p>
the <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> option to the address of the
JSON data source.</p> <p>The <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> option also allows for more advanced configuration such as altering how the Ajax request is made. See the <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> documentation and the <a href="../ajax">other Ajax examples</a> for further information.</p>
<p>The <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> option also allows for more
advanced configuration such as altering how the Ajax request is made. See the <a href="//datatables.net/reference/option/ajax"><code class="option" title= <p>The example below shows DataTables loading data for a table from arrays as the data source (object parameters can also be used through the <a href="//datatables.net/reference/option/columns.data"><code class="option" title="DataTables initialisation option">columns.data</code></a> option ).</p>
"DataTables initialisation option">ajax</code></a> documentation and the <a href="../ajax">other Ajax examples</a> for further information.</p>
<p>The example below shows DataTables loading data for a table from arrays as the data source (object parameters can also be used through the <a href= </div>
"//datatables.net/reference/option/columns.data"><code class="option" title="DataTables initialisation option">columns.data</code></a> option ).</p>
</div>
<table id="example" class="display" cellspacing="0" width="100%"> <table id="example" class="display" cellspacing="0" width="100%"><thead><tr><th>Name</th><th>Position</th><th>Office</th><th>Extn.</th><th>Start date</th><th>Salary</th></tr></thead><tfoot><tr><th>Name</th><th>Position</th><th>Office</th><th>Extn.</th><th>Start date</th><th>Salary</th></tr></tfoot></table>
<thead>
<tr> <ul class="tabs">
<th>Name</th> <li class="active">Javascript</li>
<th>Position</th> <li>HTML</li>
<th>Office</th> <li>CSS</li>
<th>Extn.</th> <li>Ajax</li>
<th>Start date</th> <li>Server-side script</li>
<th>Salary</th> </ul>
</tr>
</thead> <div class="tabs">
<tfoot> <div class="js">
<tr> <p>The Javascript shown below is used to initialise the table shown in this example:</p>
<th>Name</th> <code class="multiline language-js">$(document).ready(function() {
<th>Position</th>
<th>Office</th>
<th>Extn.</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
&quot;ajax&quot;: '../ajax/data/arrays.txt' &quot;ajax&quot;: '../ajax/data/arrays.txt'
} ); } );
} );</code> } );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul> <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<li> <ul><li><a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a></li><li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li></ul>
<a href="//code.jquery.com/jquery-1.12.3.js">//code.jquery.com/jquery-1.12.3.js</a> </div>
</li> <div class="table">
<li> <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
<a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a> </div>
</li> <div class="css">
</ul> <div>
</div> <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 additional CSS used is shown below:</p>
<div class="table"> <code class="multiline language-css"></code>
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p> </div>
</div>
<div class="css"> <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<div> <ul><li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li></ul>
<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 </div>
additional CSS used is shown below:</p><code class="multiline language-css"></code> <div class="ajax">
<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 loaded.</p>
</div>
<div class="php">
<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 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables documentation</a>.</p>
</div> </div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a>
</li>
</ul>
</div> </div>
<div class="ajax"> </section>
<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
loaded.</p>
</div> </div>
<div class="php">
<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 <section>
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables <div class="footer">
documentation</a>.</p> <div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group"><h3><a href="../basic_init/index.html
">Basic initialisation</a></h3><ul class="toc"><li><a href="../basic_init/zero_configuration.html
">Zero configuration</a></li><li><a href="../basic_init/filter_only.html
">Feature enable / disable</a></li><li><a href="../basic_init/table_sorting.html
">Default ordering (sorting)</a></li><li><a href="../basic_init/multi_col_sort.html
">Multi-column ordering</a></li><li><a href="../basic_init/multiple_tables.html
">Multiple tables</a></li><li><a href="../basic_init/hidden_columns.html
">Hidden columns</a></li><li><a href="../basic_init/complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="../basic_init/dom.html
">DOM positioning</a></li><li><a href="../basic_init/flexible_width.html
">Flexible table width</a></li><li><a href="../basic_init/state_save.html
">State saving</a></li><li><a href="../basic_init/alt_pagination.html
">Alternative pagination</a></li><li><a href="../basic_init/scroll_y.html
">Scroll - vertical</a></li><li><a href="../basic_init/scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="../basic_init/scroll_x.html
">Scroll - horizontal</a></li><li><a href="../basic_init/scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="../basic_init/comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="../basic_init/language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="../advanced_init/index.html
">Advanced initialisation</a></h3><ul class="toc"><li><a href="../advanced_init/events_live.html
">DOM / jQuery events</a></li><li><a href="../advanced_init/dt_events.html
">DataTables events</a></li><li><a href="../advanced_init/column_render.html
">Column rendering</a></li><li><a href="../advanced_init/length_menu.html
">Page length options</a></li><li><a href="../advanced_init/dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="../advanced_init/complex_header.html
">Complex headers with column visibility</a></li><li><a href="../advanced_init/object_dom_read.html
">Read HTML to data objects</a></li><li><a href="../advanced_init/html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="../advanced_init/html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="../advanced_init/language_file.html
">Language file</a></li><li><a href="../advanced_init/defaults.html
">Setting defaults</a></li><li><a href="../advanced_init/row_callback.html
">Row created callback</a></li><li><a href="../advanced_init/row_grouping.html
">Row grouping</a></li><li><a href="../advanced_init/footer_callback.html
">Footer callback</a></li><li><a href="../advanced_init/dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="../advanced_init/sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="../styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="../styling/display.html
">Base style</a></li><li><a href="../styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="../styling/cell-border.html
">Base style - cell borders</a></li><li><a href="../styling/compact.html
">Base style - compact</a></li><li><a href="../styling/hover.html
">Base style - hover</a></li><li><a href="../styling/order-column.html
">Base style - order-column</a></li><li><a href="../styling/row-border.html
">Base style - row borders</a></li><li><a href="../styling/stripe.html
">Base style - stripe</a></li><li><a href="../styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="../styling/foundation.html
">Foundation</a></li><li><a href="../styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="../styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="../styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="../styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="../styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="./index.html
">Data sources</a></h3><ul class="toc active"><li><a href="./dom.html
">HTML (DOM) sourced data</a></li><li class="active"><a href="./ajax.html
">Ajax sourced data</a></li><li><a href="./js_array.html
">Javascript sourced data</a></li><li><a href="./server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="../api/index.html
">API</a></h3><ul class="toc"><li><a href="../api/add_row.html
">Add rows</a></li><li><a href="../api/multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="../api/multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="../api/highlight.html
">Highlighting rows and columns</a></li><li><a href="../api/row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="../api/select_row.html
">Row selection (multiple rows)</a></li><li><a href="../api/select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="../api/form.html
">Form inputs</a></li><li><a href="../api/counter_columns.html
">Index column</a></li><li><a href="../api/show_hide.html
">Show / hide columns dynamically</a></li><li><a href="../api/api_in_init.html
">Using API in callbacks</a></li><li><a href="../api/tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="../api/regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="../ajax/index.html
">Ajax</a></h3><ul class="toc"><li><a href="../ajax/simple.html
">Ajax data source (arrays)</a></li><li><a href="../ajax/objects.html
">Ajax data source (objects)</a></li><li><a href="../ajax/deep.html
">Nested object data (objects)</a></li><li><a href="../ajax/objects_subarrays.html
">Nested object data (arrays)</a></li><li><a href="../ajax/orthogonal-data.html
">Orthogonal data</a></li><li><a href="../ajax/null_data_source.html
">Generated content for a column</a></li><li><a href="../ajax/custom_data_property.html
">Custom data source property</a></li><li><a href="../ajax/custom_data_flat.html
">Flat array data source</a></li><li><a href="../ajax/defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="../server_side/index.html
">Server-side</a></h3><ul class="toc"><li><a href="../server_side/simple.html
">Server-side processing</a></li><li><a href="../server_side/custom_vars.html
">Custom HTTP variables</a></li><li><a href="../server_side/post.html
">POST data</a></li><li><a href="../server_side/ids.html
">Automatic addition of row ID attributes</a></li><li><a href="../server_side/object_data.html
">Object data source</a></li><li><a href="../server_side/row_details.html
">Row details</a></li><li><a href="../server_side/select_rows.html
">Row selection</a></li><li><a href="../server_side/jsonp.html
">JSONP data source for remote domains</a></li><li><a href="../server_side/defer_loading.html
">Deferred loading of data</a></li><li><a href="../server_side/pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="../plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="../plug-ins/api.html
">API plug-in methods</a></li><li><a href="../plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="../plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="../plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="../plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div> </div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="../basic_init/index.html">Basic initialisation</a></h3>
<ul class="toc">
<li>
<a href="../basic_init/zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="../basic_init/filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="../basic_init/table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="../basic_init/multi_col_sort.html">Multi-column ordering</a>
</li>
<li>
<a href="../basic_init/multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="../basic_init/hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="../basic_init/complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="../basic_init/dom.html">DOM positioning</a>
</li>
<li>
<a href="../basic_init/flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="../basic_init/state_save.html">State saving</a>
</li>
<li>
<a href="../basic_init/alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="../basic_init/scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="../basic_init/scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="../basic_init/scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="../basic_init/scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="../basic_init/comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="../basic_init/language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../advanced_init/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="../advanced_init/events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="../advanced_init/dt_events.html">DataTables events</a>
</li>
<li>
<a href="../advanced_init/column_render.html">Column rendering</a>
</li>
<li>
<a href="../advanced_init/length_menu.html">Page length options</a>
</li>
<li>
<a href="../advanced_init/dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="../advanced_init/complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="../advanced_init/object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="../advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="../advanced_init/language_file.html">Language file</a>
</li>
<li>
<a href="../advanced_init/defaults.html">Setting defaults</a>
</li>
<li>
<a href="../advanced_init/row_callback.html">Row created callback</a>
</li>
<li>
<a href="../advanced_init/row_grouping.html">Row grouping</a>
</li>
<li>
<a href="../advanced_init/footer_callback.html">Footer callback</a>
</li>
<li>
<a href="../advanced_init/dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="../advanced_init/sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/display.html">Base style</a>
</li>
<li>
<a href="../styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="../styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="../styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="../styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="../styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="../styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="../styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="../styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="../styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./index.html">Data sources</a></h3>
<ul class="toc active">
<li>
<a href="./dom.html">HTML (DOM) sourced data</a>
</li>
<li class="active">
<a href="./ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="./js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="./server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="../api/add_row.html">Add rows</a>
</li>
<li>
<a href="../api/multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="../api/multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="../api/highlight.html">Highlighting rows and columns</a>
</li>
<li>
<a href="../api/row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="../api/select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="../api/select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="../api/form.html">Form inputs</a>
</li>
<li>
<a href="../api/counter_columns.html">Index column</a>
</li>
<li>
<a href="../api/show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="../api/api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="../api/tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="../api/regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../ajax/index.html">Ajax</a></h3>
<ul class="toc">
<li>
<a href="../ajax/simple.html">Ajax data source (arrays)</a>
</li>
<li>
<a href="../ajax/objects.html">Ajax data source (objects)</a>
</li>
<li>
<a href="../ajax/deep.html">Nested object data (objects)</a>
</li>
<li>
<a href="../ajax/objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="../ajax/orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="../ajax/null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="../ajax/custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="../ajax/custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="../ajax/defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../server_side/index.html">Server-side</a></h3>
<ul class="toc">
<li>
<a href="../server_side/simple.html">Server-side processing</a>
</li>
<li>
<a href="../server_side/custom_vars.html">Custom HTTP variables</a>
</li>
<li>
<a href="../server_side/post.html">POST data</a>
</li>
<li>
<a href="../server_side/ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="../server_side/object_data.html">Object data source</a>
</li>
<li>
<a href="../server_side/row_details.html">Row details</a>
</li>
<li>
<a href="../server_side/select_rows.html">Row selection</a>
</li>
<li>
<a href="../server_side/jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="../server_side/defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="../server_side/pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="../plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="../plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

File diff suppressed because one or more lines are too long

View File

@ -1,68 +1,60 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <title>DataTables examples - Data sources</title>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"> </head>
</script> <body class="dt-example">
<script type="text/javascript" language="javascript" src="../resources/demo.js"> <div class="container">
</script> <section>
<title>DataTables examples - Data sources</title> <h1>DataTables example <span>Data sources</span></h1>
</head> <div class="info">
<body class="dt-example"> <p>DataTables can obtain data from four different fundamental sources:</p>
<div class="container">
<ul class="markdown">
<li>HTML document (DOM)</li>
<li>Javascript (array / objects)</li>
<li>Ajax sourced data with client-side processing</li>
<li>Ajax sourced data with server-side processing</li>
</ul>
<p>Which of these options is used to populate the table with data depends upon how the table is initialised. The examples in this section show these four different data source types.</p>
</div>
</section>
</div>
<section> <section>
<h1>DataTables example <span>Data sources</span></h1> <div class="footer">
<div class="info"> <div class="gradient"></div>
<p>DataTables can obtain data from four different fundamental sources:</p> <div class="liner">
<ul class="markdown"> <div class="toc">
<li>HTML document (DOM)</li> <div class="toc-group"><h3><a href="./index.html
<li>Javascript (array / objects)</li> ">Data sources</a></h3><ul class="toc"><li><a href="./dom.html
<li>Ajax sourced data with client-side processing</li> ">HTML (DOM) sourced data</a></li><li><a href="./ajax.html
<li>Ajax sourced data with server-side processing</li> ">Ajax sourced data</a></li><li><a href="./js_array.html
</ul> ">Javascript sourced data</a></li><li><a href="./server_side.html
<p>Which of these options is used to populate the table with data depends upon how the table is initialised. The examples in this section show these four different ">Server-side processing</a></li></ul></div>
data source types.</p> </div>
</div>
</section> <div class="epilogue">
</div> <p>
<section> Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
<div class="footer"> Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
<div class="gradient"></div> </p>
<div class="liner">
<div class="toc"> <p class="copyright">
<div class="toc-group"> DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
<h3><a href="./index.html">Data sources</a></h3> DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
<ul class="toc"> </p>
<li>
<a href="./dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="./ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="./js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="./server_side.html">Server-side processing</a>
</li>
</ul>
</div> </div>
</div> </div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div> </div>
</div> </section>
</section> </body>
</body>
</html> </html>

View File

@ -1,26 +1,19 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<title>DataTables example - Javascript sourced data</title>
<link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"> <title>DataTables example - Javascript sourced data</title>
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"><link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<style type="text/css" class="init"> <style type="text/css" class="init">
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <script type="text/javascript" language="javascript" class="init">
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
var dataSet = [ var dataSet = [
[ "Tiger Nixon", "System Architect", "Edinburgh", "5421", "2011/04/25", "$320,800" ], [ "Tiger Nixon", "System Architect", "Edinburgh", "5421", "2011/04/25", "$320,800" ],
@ -76,33 +69,34 @@ $(document).ready(function() {
} ); } );
</script> </script>
</head> </head>
<body class="dt-example"> <body class="dt-example ">
<div class="container"> <div class="container">
<section> <section>
<h1>DataTables example <span>Javascript sourced data</span></h1> <h1>DataTables example <span>Javascript sourced data</span></h1>
<div class="info"> <div class="info">
<p>At times you will wish to be able to create a table from dynamic information passed directly to DataTables, rather than having it read from the document. This <p>At times you will wish to be able to create a table from dynamic information passed directly to DataTables, rather than having it read from the document. This is achieved using the <a href="//datatables.net/reference/option/data"><code class="option" title="DataTables initialisation option">data</code></a> option in the initialisation object, passing in an array of data to be used (like all other DataTables handled data, this can be arrays or objects using the <a href="//datatables.net/reference/option/columns.data"><code class="option" title="DataTables initialisation option">columns.data</code></a> option).</p>
is achieved using the <a href="//datatables.net/reference/option/data"><code class="option" title="DataTables initialisation option">data</code></a> option in the
initialisation object, passing in an array of data to be used (like all other DataTables handled data, this can be arrays or objects using the <a href= <p>A <code class="tag" title="HTML tag">table</code> must be available on the page for DataTables to use. This examples shows an empty <code class="tag" title="HTML tag">table</code> element being initialising as a DataTable with a set of data from a Javascript array. The columns in the table are dynamically created based on the <a href="//datatables.net/reference/option/columns.title"><code class="option" title="DataTables initialisation option">columns.title</code></a> configuration option.</p>
"//datatables.net/reference/option/columns.data"><code class="option" title="DataTables initialisation option">columns.data</code></a> option).</p>
<p>A <code class="tag" title="HTML tag">table</code> must be available on the page for DataTables to use. This examples shows an empty <code class="tag" title= </div>
"HTML tag">table</code> element being initialising as a DataTable with a set of data from a Javascript array. The columns in the table are dynamically created
based on the <a href="//datatables.net/reference/option/columns.title"><code class="option" title="DataTables initialisation option">columns.title</code></a>
configuration option.</p> <table id="example" class="display" width="100%"> </table>
</div>
<table id="example" class="display" width="100%"></table> <ul class="tabs">
<ul class="tabs"> <li class="active">Javascript</li>
<li class="active">Javascript</li> <li>HTML</li>
<li>HTML</li> <li>CSS</li>
<li>CSS</li> <li>Ajax</li>
<li>Ajax</li> <li>Server-side script</li>
<li>Server-side script</li> </ul>
</ul>
<div class="tabs"> <div class="tabs">
<div class="js"> <div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">var dataSet = [ <p>The Javascript shown below is used to initialise the table shown in this example:</p>
<code class="multiline language-js">var dataSet = [
[ &quot;Tiger Nixon&quot;, &quot;System Architect&quot;, &quot;Edinburgh&quot;, &quot;5421&quot;, &quot;2011/04/25&quot;, &quot;$320,800&quot; ], [ &quot;Tiger Nixon&quot;, &quot;System Architect&quot;, &quot;Edinburgh&quot;, &quot;5421&quot;, &quot;2011/04/25&quot;, &quot;$320,800&quot; ],
[ &quot;Garrett Winters&quot;, &quot;Accountant&quot;, &quot;Tokyo&quot;, &quot;8422&quot;, &quot;2011/07/25&quot;, &quot;$170,750&quot; ], [ &quot;Garrett Winters&quot;, &quot;Accountant&quot;, &quot;Tokyo&quot;, &quot;8422&quot;, &quot;2011/07/25&quot;, &quot;$170,750&quot; ],
[ &quot;Ashton Cox&quot;, &quot;Junior Technical Author&quot;, &quot;San Francisco&quot;, &quot;1562&quot;, &quot;2009/01/12&quot;, &quot;$86,000&quot; ], [ &quot;Ashton Cox&quot;, &quot;Junior Technical Author&quot;, &quot;San Francisco&quot;, &quot;1562&quot;, &quot;2009/01/12&quot;, &quot;$86,000&quot; ],
@ -154,366 +148,153 @@ $(document).ready(function() {
] ]
} ); } );
} );</code> } );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul> <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<li> <ul><li><a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a></li><li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li></ul>
<a href="//code.jquery.com/jquery-1.12.3.js">//code.jquery.com/jquery-1.12.3.js</a> </div>
</li> <div class="table">
<li> <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
<a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a> </div>
</li> <div class="css">
</ul> <div>
</div> <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 additional CSS used is shown below:</p>
<div class="table"> <code class="multiline language-css"></code>
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p> </div>
</div>
<div class="css"> <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<div> <ul><li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li></ul>
<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 </div>
additional CSS used is shown below:</p><code class="multiline language-css"></code> <div class="ajax">
<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 loaded.</p>
</div>
<div class="php">
<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 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables documentation</a>.</p>
</div> </div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a>
</li>
</ul>
</div> </div>
<div class="ajax"> </section>
<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
loaded.</p>
</div> </div>
<div class="php">
<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 <section>
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables <div class="footer">
documentation</a>.</p> <div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group"><h3><a href="../basic_init/index.html
">Basic initialisation</a></h3><ul class="toc"><li><a href="../basic_init/zero_configuration.html
">Zero configuration</a></li><li><a href="../basic_init/filter_only.html
">Feature enable / disable</a></li><li><a href="../basic_init/table_sorting.html
">Default ordering (sorting)</a></li><li><a href="../basic_init/multi_col_sort.html
">Multi-column ordering</a></li><li><a href="../basic_init/multiple_tables.html
">Multiple tables</a></li><li><a href="../basic_init/hidden_columns.html
">Hidden columns</a></li><li><a href="../basic_init/complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="../basic_init/dom.html
">DOM positioning</a></li><li><a href="../basic_init/flexible_width.html
">Flexible table width</a></li><li><a href="../basic_init/state_save.html
">State saving</a></li><li><a href="../basic_init/alt_pagination.html
">Alternative pagination</a></li><li><a href="../basic_init/scroll_y.html
">Scroll - vertical</a></li><li><a href="../basic_init/scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="../basic_init/scroll_x.html
">Scroll - horizontal</a></li><li><a href="../basic_init/scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="../basic_init/comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="../basic_init/language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="../advanced_init/index.html
">Advanced initialisation</a></h3><ul class="toc"><li><a href="../advanced_init/events_live.html
">DOM / jQuery events</a></li><li><a href="../advanced_init/dt_events.html
">DataTables events</a></li><li><a href="../advanced_init/column_render.html
">Column rendering</a></li><li><a href="../advanced_init/length_menu.html
">Page length options</a></li><li><a href="../advanced_init/dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="../advanced_init/complex_header.html
">Complex headers with column visibility</a></li><li><a href="../advanced_init/object_dom_read.html
">Read HTML to data objects</a></li><li><a href="../advanced_init/html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="../advanced_init/html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="../advanced_init/language_file.html
">Language file</a></li><li><a href="../advanced_init/defaults.html
">Setting defaults</a></li><li><a href="../advanced_init/row_callback.html
">Row created callback</a></li><li><a href="../advanced_init/row_grouping.html
">Row grouping</a></li><li><a href="../advanced_init/footer_callback.html
">Footer callback</a></li><li><a href="../advanced_init/dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="../advanced_init/sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="../styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="../styling/display.html
">Base style</a></li><li><a href="../styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="../styling/cell-border.html
">Base style - cell borders</a></li><li><a href="../styling/compact.html
">Base style - compact</a></li><li><a href="../styling/hover.html
">Base style - hover</a></li><li><a href="../styling/order-column.html
">Base style - order-column</a></li><li><a href="../styling/row-border.html
">Base style - row borders</a></li><li><a href="../styling/stripe.html
">Base style - stripe</a></li><li><a href="../styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="../styling/foundation.html
">Foundation</a></li><li><a href="../styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="../styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="../styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="../styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="../styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="./index.html
">Data sources</a></h3><ul class="toc active"><li><a href="./dom.html
">HTML (DOM) sourced data</a></li><li><a href="./ajax.html
">Ajax sourced data</a></li><li class="active"><a href="./js_array.html
">Javascript sourced data</a></li><li><a href="./server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="../api/index.html
">API</a></h3><ul class="toc"><li><a href="../api/add_row.html
">Add rows</a></li><li><a href="../api/multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="../api/multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="../api/highlight.html
">Highlighting rows and columns</a></li><li><a href="../api/row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="../api/select_row.html
">Row selection (multiple rows)</a></li><li><a href="../api/select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="../api/form.html
">Form inputs</a></li><li><a href="../api/counter_columns.html
">Index column</a></li><li><a href="../api/show_hide.html
">Show / hide columns dynamically</a></li><li><a href="../api/api_in_init.html
">Using API in callbacks</a></li><li><a href="../api/tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="../api/regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="../ajax/index.html
">Ajax</a></h3><ul class="toc"><li><a href="../ajax/simple.html
">Ajax data source (arrays)</a></li><li><a href="../ajax/objects.html
">Ajax data source (objects)</a></li><li><a href="../ajax/deep.html
">Nested object data (objects)</a></li><li><a href="../ajax/objects_subarrays.html
">Nested object data (arrays)</a></li><li><a href="../ajax/orthogonal-data.html
">Orthogonal data</a></li><li><a href="../ajax/null_data_source.html
">Generated content for a column</a></li><li><a href="../ajax/custom_data_property.html
">Custom data source property</a></li><li><a href="../ajax/custom_data_flat.html
">Flat array data source</a></li><li><a href="../ajax/defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="../server_side/index.html
">Server-side</a></h3><ul class="toc"><li><a href="../server_side/simple.html
">Server-side processing</a></li><li><a href="../server_side/custom_vars.html
">Custom HTTP variables</a></li><li><a href="../server_side/post.html
">POST data</a></li><li><a href="../server_side/ids.html
">Automatic addition of row ID attributes</a></li><li><a href="../server_side/object_data.html
">Object data source</a></li><li><a href="../server_side/row_details.html
">Row details</a></li><li><a href="../server_side/select_rows.html
">Row selection</a></li><li><a href="../server_side/jsonp.html
">JSONP data source for remote domains</a></li><li><a href="../server_side/defer_loading.html
">Deferred loading of data</a></li><li><a href="../server_side/pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="../plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="../plug-ins/api.html
">API plug-in methods</a></li><li><a href="../plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="../plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="../plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="../plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div> </div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="../basic_init/index.html">Basic initialisation</a></h3>
<ul class="toc">
<li>
<a href="../basic_init/zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="../basic_init/filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="../basic_init/table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="../basic_init/multi_col_sort.html">Multi-column ordering</a>
</li>
<li>
<a href="../basic_init/multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="../basic_init/hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="../basic_init/complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="../basic_init/dom.html">DOM positioning</a>
</li>
<li>
<a href="../basic_init/flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="../basic_init/state_save.html">State saving</a>
</li>
<li>
<a href="../basic_init/alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="../basic_init/scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="../basic_init/scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="../basic_init/scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="../basic_init/scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="../basic_init/comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="../basic_init/language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../advanced_init/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="../advanced_init/events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="../advanced_init/dt_events.html">DataTables events</a>
</li>
<li>
<a href="../advanced_init/column_render.html">Column rendering</a>
</li>
<li>
<a href="../advanced_init/length_menu.html">Page length options</a>
</li>
<li>
<a href="../advanced_init/dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="../advanced_init/complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="../advanced_init/object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="../advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="../advanced_init/language_file.html">Language file</a>
</li>
<li>
<a href="../advanced_init/defaults.html">Setting defaults</a>
</li>
<li>
<a href="../advanced_init/row_callback.html">Row created callback</a>
</li>
<li>
<a href="../advanced_init/row_grouping.html">Row grouping</a>
</li>
<li>
<a href="../advanced_init/footer_callback.html">Footer callback</a>
</li>
<li>
<a href="../advanced_init/dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="../advanced_init/sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/display.html">Base style</a>
</li>
<li>
<a href="../styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="../styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="../styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="../styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="../styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="../styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="../styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="../styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="../styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./index.html">Data sources</a></h3>
<ul class="toc active">
<li>
<a href="./dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="./ajax.html">Ajax sourced data</a>
</li>
<li class="active">
<a href="./js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="./server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="../api/add_row.html">Add rows</a>
</li>
<li>
<a href="../api/multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="../api/multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="../api/highlight.html">Highlighting rows and columns</a>
</li>
<li>
<a href="../api/row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="../api/select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="../api/select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="../api/form.html">Form inputs</a>
</li>
<li>
<a href="../api/counter_columns.html">Index column</a>
</li>
<li>
<a href="../api/show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="../api/api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="../api/tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="../api/regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../ajax/index.html">Ajax</a></h3>
<ul class="toc">
<li>
<a href="../ajax/simple.html">Ajax data source (arrays)</a>
</li>
<li>
<a href="../ajax/objects.html">Ajax data source (objects)</a>
</li>
<li>
<a href="../ajax/deep.html">Nested object data (objects)</a>
</li>
<li>
<a href="../ajax/objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="../ajax/orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="../ajax/null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="../ajax/custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="../ajax/custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="../ajax/defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../server_side/index.html">Server-side</a></h3>
<ul class="toc">
<li>
<a href="../server_side/simple.html">Server-side processing</a>
</li>
<li>
<a href="../server_side/custom_vars.html">Custom HTTP variables</a>
</li>
<li>
<a href="../server_side/post.html">POST data</a>
</li>
<li>
<a href="../server_side/ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="../server_side/object_data.html">Object data source</a>
</li>
<li>
<a href="../server_side/row_details.html">Row details</a>
</li>
<li>
<a href="../server_side/select_rows.html">Row selection</a>
</li>
<li>
<a href="../server_side/jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="../server_side/defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="../server_side/pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="../plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="../plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

View File

@ -1,26 +1,19 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<title>DataTables example - Server-side processing</title>
<link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"> <title>DataTables example - Server-side processing</title>
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"><link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<style type="text/css" class="init"> <style type="text/css" class="init">
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <script type="text/javascript" language="javascript" class="init">
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() { $(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
"processing": true, "processing": true,
@ -29,421 +22,189 @@ $(document).ready(function() {
} ); } );
} ); } );
</script> </script>
</head> </head>
<body class="dt-example"> <body class="dt-example ">
<div class="container"> <div class="container">
<section> <section>
<h1>DataTables example <span>Server-side processing</span></h1> <h1>DataTables example <span>Server-side processing</span></h1>
<div class="info"> <div class="info">
<p>There are many ways to get your data into DataTables, and if you are working with seriously large databases, you might want to consider using the server-side <p>There are many ways to get your data into DataTables, and if you are working with seriously large databases, you might want to consider using the server-side options that DataTables provides. With server-side processing enabled, all paging, searching, ordering actions that DataTables performs are handed off to a server where an SQL engine (or similar) can perform these actions on the large data set (after all, that's what the database engine is designed for!). As such, each draw of the table will result in a new Ajax request being made to get the required data.</p>
options that DataTables provides. With server-side processing enabled, all paging, searching, ordering actions that DataTables performs are handed off to a server
where an SQL engine (or similar) can perform these actions on the large data set (after all, that's what the database engine is designed for!). As such, each draw <p>Server-side processing is enabled by setting the <a href="//datatables.net/reference/option/serverSide"><code class="option" title="DataTables initialisation option">serverSide</code></a> option to <code>true</code> and providing an Ajax data source through the <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> option.</p>
of the table will result in a new Ajax request being made to get the required data.</p>
<p>Server-side processing is enabled by setting the <a href="//datatables.net/reference/option/serverSide"><code class="option" title= <p>This example shows a very simple table, matching the other examples, but in this instance using server-side processing. For further and more complex examples of using server-side processing, please refer to the <a href="../server_side">server-side processing</a> examples.</p>
"DataTables initialisation option">serverSide</code></a> option to <code>true</code> and providing an Ajax data source through the <a href=
"//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> option.</p> </div>
<p>This example shows a very simple table, matching the other examples, but in this instance using server-side processing. For further and more complex examples of
using server-side processing, please refer to the <a href="../server_side">server-side processing</a> examples.</p>
</div> <table id="example" class="display" cellspacing="0" width="100%"><thead><tr><th>First name</th><th>Last name</th><th>Position</th><th>Office</th><th>Start date</th><th>Salary</th></tr></thead><tfoot><tr><th>First name</th><th>Last name</th><th>Position</th><th>Office</th><th>Start date</th><th>Salary</th></tr></tfoot></table>
<table id="example" class="display" cellspacing="0" width="100%">
<thead> <ul class="tabs">
<tr> <li class="active">Javascript</li>
<th>First name</th> <li>HTML</li>
<th>Last name</th> <li>CSS</li>
<th>Position</th> <li>Ajax</li>
<th>Office</th> <li>Server-side script</li>
<th>Start date</th> </ul>
<th>Salary</th>
</tr> <div class="tabs">
</thead> <div class="js">
<tfoot> <p>The Javascript shown below is used to initialise the table shown in this example:</p>
<tr> <code class="multiline language-js">$(document).ready(function() {
<th>First name</th>
<th>Last name</th>
<th>Position</th>
<th>Office</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
&quot;processing&quot;: true, &quot;processing&quot;: true,
&quot;serverSide&quot;: true, &quot;serverSide&quot;: true,
&quot;ajax&quot;: &quot;../server_side/scripts/server_processing.php&quot; &quot;ajax&quot;: &quot;../server_side/scripts/server_processing.php&quot;
} ); } );
} );</code> } );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul> <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<li> <ul><li><a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a></li><li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li></ul>
<a href="//code.jquery.com/jquery-1.12.3.js">//code.jquery.com/jquery-1.12.3.js</a> </div>
</li> <div class="table">
<li> <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
<a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a> </div>
</li> <div class="css">
</ul> <div>
</div> <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 additional CSS used is shown below:</p>
<div class="table"> <code class="multiline language-css"></code>
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p> </div>
</div>
<div class="css"> <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<div> <ul><li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li></ul>
<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 </div>
additional CSS used is shown below:</p><code class="multiline language-css"></code> <div class="ajax">
<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 loaded.</p>
</div>
<div class="php">
<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 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables documentation</a>.</p>
</div> </div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a>
</li>
</ul>
</div> </div>
<div class="ajax"> </section>
<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
loaded.</p>
</div> </div>
<div class="php">
<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 <section>
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables <div class="footer">
documentation</a>.</p> <div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group"><h3><a href="../basic_init/index.html
">Basic initialisation</a></h3><ul class="toc"><li><a href="../basic_init/zero_configuration.html
">Zero configuration</a></li><li><a href="../basic_init/filter_only.html
">Feature enable / disable</a></li><li><a href="../basic_init/table_sorting.html
">Default ordering (sorting)</a></li><li><a href="../basic_init/multi_col_sort.html
">Multi-column ordering</a></li><li><a href="../basic_init/multiple_tables.html
">Multiple tables</a></li><li><a href="../basic_init/hidden_columns.html
">Hidden columns</a></li><li><a href="../basic_init/complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="../basic_init/dom.html
">DOM positioning</a></li><li><a href="../basic_init/flexible_width.html
">Flexible table width</a></li><li><a href="../basic_init/state_save.html
">State saving</a></li><li><a href="../basic_init/alt_pagination.html
">Alternative pagination</a></li><li><a href="../basic_init/scroll_y.html
">Scroll - vertical</a></li><li><a href="../basic_init/scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="../basic_init/scroll_x.html
">Scroll - horizontal</a></li><li><a href="../basic_init/scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="../basic_init/comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="../basic_init/language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="../advanced_init/index.html
">Advanced initialisation</a></h3><ul class="toc"><li><a href="../advanced_init/events_live.html
">DOM / jQuery events</a></li><li><a href="../advanced_init/dt_events.html
">DataTables events</a></li><li><a href="../advanced_init/column_render.html
">Column rendering</a></li><li><a href="../advanced_init/length_menu.html
">Page length options</a></li><li><a href="../advanced_init/dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="../advanced_init/complex_header.html
">Complex headers with column visibility</a></li><li><a href="../advanced_init/object_dom_read.html
">Read HTML to data objects</a></li><li><a href="../advanced_init/html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="../advanced_init/html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="../advanced_init/language_file.html
">Language file</a></li><li><a href="../advanced_init/defaults.html
">Setting defaults</a></li><li><a href="../advanced_init/row_callback.html
">Row created callback</a></li><li><a href="../advanced_init/row_grouping.html
">Row grouping</a></li><li><a href="../advanced_init/footer_callback.html
">Footer callback</a></li><li><a href="../advanced_init/dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="../advanced_init/sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="../styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="../styling/display.html
">Base style</a></li><li><a href="../styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="../styling/cell-border.html
">Base style - cell borders</a></li><li><a href="../styling/compact.html
">Base style - compact</a></li><li><a href="../styling/hover.html
">Base style - hover</a></li><li><a href="../styling/order-column.html
">Base style - order-column</a></li><li><a href="../styling/row-border.html
">Base style - row borders</a></li><li><a href="../styling/stripe.html
">Base style - stripe</a></li><li><a href="../styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="../styling/foundation.html
">Foundation</a></li><li><a href="../styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="../styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="../styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="../styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="../styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="./index.html
">Data sources</a></h3><ul class="toc active"><li><a href="./dom.html
">HTML (DOM) sourced data</a></li><li><a href="./ajax.html
">Ajax sourced data</a></li><li><a href="./js_array.html
">Javascript sourced data</a></li><li class="active"><a href="./server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="../api/index.html
">API</a></h3><ul class="toc"><li><a href="../api/add_row.html
">Add rows</a></li><li><a href="../api/multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="../api/multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="../api/highlight.html
">Highlighting rows and columns</a></li><li><a href="../api/row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="../api/select_row.html
">Row selection (multiple rows)</a></li><li><a href="../api/select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="../api/form.html
">Form inputs</a></li><li><a href="../api/counter_columns.html
">Index column</a></li><li><a href="../api/show_hide.html
">Show / hide columns dynamically</a></li><li><a href="../api/api_in_init.html
">Using API in callbacks</a></li><li><a href="../api/tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="../api/regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="../ajax/index.html
">Ajax</a></h3><ul class="toc"><li><a href="../ajax/simple.html
">Ajax data source (arrays)</a></li><li><a href="../ajax/objects.html
">Ajax data source (objects)</a></li><li><a href="../ajax/deep.html
">Nested object data (objects)</a></li><li><a href="../ajax/objects_subarrays.html
">Nested object data (arrays)</a></li><li><a href="../ajax/orthogonal-data.html
">Orthogonal data</a></li><li><a href="../ajax/null_data_source.html
">Generated content for a column</a></li><li><a href="../ajax/custom_data_property.html
">Custom data source property</a></li><li><a href="../ajax/custom_data_flat.html
">Flat array data source</a></li><li><a href="../ajax/defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="../server_side/index.html
">Server-side</a></h3><ul class="toc"><li><a href="../server_side/simple.html
">Server-side processing</a></li><li><a href="../server_side/custom_vars.html
">Custom HTTP variables</a></li><li><a href="../server_side/post.html
">POST data</a></li><li><a href="../server_side/ids.html
">Automatic addition of row ID attributes</a></li><li><a href="../server_side/object_data.html
">Object data source</a></li><li><a href="../server_side/row_details.html
">Row details</a></li><li><a href="../server_side/select_rows.html
">Row selection</a></li><li><a href="../server_side/jsonp.html
">JSONP data source for remote domains</a></li><li><a href="../server_side/defer_loading.html
">Deferred loading of data</a></li><li><a href="../server_side/pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="../plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="../plug-ins/api.html
">API plug-in methods</a></li><li><a href="../plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="../plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="../plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="../plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div> </div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="../basic_init/index.html">Basic initialisation</a></h3>
<ul class="toc">
<li>
<a href="../basic_init/zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="../basic_init/filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="../basic_init/table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="../basic_init/multi_col_sort.html">Multi-column ordering</a>
</li>
<li>
<a href="../basic_init/multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="../basic_init/hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="../basic_init/complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="../basic_init/dom.html">DOM positioning</a>
</li>
<li>
<a href="../basic_init/flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="../basic_init/state_save.html">State saving</a>
</li>
<li>
<a href="../basic_init/alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="../basic_init/scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="../basic_init/scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="../basic_init/scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="../basic_init/scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="../basic_init/comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="../basic_init/language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../advanced_init/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="../advanced_init/events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="../advanced_init/dt_events.html">DataTables events</a>
</li>
<li>
<a href="../advanced_init/column_render.html">Column rendering</a>
</li>
<li>
<a href="../advanced_init/length_menu.html">Page length options</a>
</li>
<li>
<a href="../advanced_init/dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="../advanced_init/complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="../advanced_init/object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="../advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="../advanced_init/language_file.html">Language file</a>
</li>
<li>
<a href="../advanced_init/defaults.html">Setting defaults</a>
</li>
<li>
<a href="../advanced_init/row_callback.html">Row created callback</a>
</li>
<li>
<a href="../advanced_init/row_grouping.html">Row grouping</a>
</li>
<li>
<a href="../advanced_init/footer_callback.html">Footer callback</a>
</li>
<li>
<a href="../advanced_init/dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="../advanced_init/sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/display.html">Base style</a>
</li>
<li>
<a href="../styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="../styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="../styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="../styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="../styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="../styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="../styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="../styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="../styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./index.html">Data sources</a></h3>
<ul class="toc active">
<li>
<a href="./dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="./ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="./js_array.html">Javascript sourced data</a>
</li>
<li class="active">
<a href="./server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="../api/add_row.html">Add rows</a>
</li>
<li>
<a href="../api/multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="../api/multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="../api/highlight.html">Highlighting rows and columns</a>
</li>
<li>
<a href="../api/row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="../api/select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="../api/select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="../api/form.html">Form inputs</a>
</li>
<li>
<a href="../api/counter_columns.html">Index column</a>
</li>
<li>
<a href="../api/show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="../api/api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="../api/tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="../api/regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../ajax/index.html">Ajax</a></h3>
<ul class="toc">
<li>
<a href="../ajax/simple.html">Ajax data source (arrays)</a>
</li>
<li>
<a href="../ajax/objects.html">Ajax data source (objects)</a>
</li>
<li>
<a href="../ajax/deep.html">Nested object data (objects)</a>
</li>
<li>
<a href="../ajax/objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="../ajax/orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="../ajax/null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="../ajax/custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="../ajax/custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="../ajax/defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../server_side/index.html">Server-side</a></h3>
<ul class="toc">
<li>
<a href="../server_side/simple.html">Server-side processing</a>
</li>
<li>
<a href="../server_side/custom_vars.html">Custom HTTP variables</a>
</li>
<li>
<a href="../server_side/post.html">POST data</a>
</li>
<li>
<a href="../server_side/ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="../server_side/object_data.html">Object data source</a>
</li>
<li>
<a href="../server_side/row_details.html">Row details</a>
</li>
<li>
<a href="../server_side/select_rows.html">Row selection</a>
</li>
<li>
<a href="../server_side/jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="../server_side/defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="../server_side/pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="../plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="../plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

View File

@ -1,352 +1,143 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<link rel="stylesheet" type="text/css" href="./resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="./resources/demo.css"> <link rel="stylesheet" type="text/css" href="./resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="./resources/demo.css">
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="./resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="./resources/demo.js"></script>
</script> <title>DataTables examples - Examples index</title>
<script type="text/javascript" language="javascript" src="./resources/syntax/shCore.js"> </head>
</script> <body class="dt-example">
<script type="text/javascript" language="javascript" src="./resources/demo.js"> <div class="container">
</script> <section>
<title>DataTables examples - Examples index</title> <h1>DataTables example <span>Examples index</span></h1>
</head> <div class="info">
<body class="dt-example"> <p>One of the best ways to learn how to do anything new (including software APIs!) is to get your hands dirty as quickly as possible. These examples will show you how to perform tasks ranging from something as simple as applying DataTables to an HTML table, right the way through to doing server-side processing with pipelining and custom plug-in functions.</p>
<div class="container">
</div>
</section>
</div>
<section> <section>
<h1>DataTables example <span>Examples index</span></h1> <div class="footer">
<div class="info"> <div class="gradient"></div>
<p>One of the best ways to learn how to do anything new (including software APIs!) is to get your hands dirty as quickly as possible. These examples will show you <div class="liner">
how to perform tasks ranging from something as simple as applying DataTables to an HTML table, right the way through to doing server-side processing with <div class="toc">
pipelining and custom plug-in functions.</p> <div class="toc-group"><h3><a href="./basic_init/index.html
">Basic initialisation</a></h3><ul class="toc"><li><a href="./basic_init/zero_configuration.html
">Zero configuration</a></li><li><a href="./basic_init/filter_only.html
">Feature enable / disable</a></li><li><a href="./basic_init/table_sorting.html
">Default ordering (sorting)</a></li><li><a href="./basic_init/multi_col_sort.html
">Multi-column ordering</a></li><li><a href="./basic_init/multiple_tables.html
">Multiple tables</a></li><li><a href="./basic_init/hidden_columns.html
">Hidden columns</a></li><li><a href="./basic_init/complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="./basic_init/dom.html
">DOM positioning</a></li><li><a href="./basic_init/flexible_width.html
">Flexible table width</a></li><li><a href="./basic_init/state_save.html
">State saving</a></li><li><a href="./basic_init/alt_pagination.html
">Alternative pagination</a></li><li><a href="./basic_init/scroll_y.html
">Scroll - vertical</a></li><li><a href="./basic_init/scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="./basic_init/scroll_x.html
">Scroll - horizontal</a></li><li><a href="./basic_init/scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="./basic_init/comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="./basic_init/language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="./advanced_init/index.html
">Advanced initialisation</a></h3><ul class="toc"><li><a href="./advanced_init/events_live.html
">DOM / jQuery events</a></li><li><a href="./advanced_init/dt_events.html
">DataTables events</a></li><li><a href="./advanced_init/column_render.html
">Column rendering</a></li><li><a href="./advanced_init/length_menu.html
">Page length options</a></li><li><a href="./advanced_init/dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="./advanced_init/complex_header.html
">Complex headers with column visibility</a></li><li><a href="./advanced_init/object_dom_read.html
">Read HTML to data objects</a></li><li><a href="./advanced_init/html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="./advanced_init/html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="./advanced_init/language_file.html
">Language file</a></li><li><a href="./advanced_init/defaults.html
">Setting defaults</a></li><li><a href="./advanced_init/row_callback.html
">Row created callback</a></li><li><a href="./advanced_init/row_grouping.html
">Row grouping</a></li><li><a href="./advanced_init/footer_callback.html
">Footer callback</a></li><li><a href="./advanced_init/dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="./advanced_init/sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="./styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="./styling/display.html
">Base style</a></li><li><a href="./styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="./styling/cell-border.html
">Base style - cell borders</a></li><li><a href="./styling/compact.html
">Base style - compact</a></li><li><a href="./styling/hover.html
">Base style - hover</a></li><li><a href="./styling/order-column.html
">Base style - order-column</a></li><li><a href="./styling/row-border.html
">Base style - row borders</a></li><li><a href="./styling/stripe.html
">Base style - stripe</a></li><li><a href="./styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="./styling/foundation.html
">Foundation</a></li><li><a href="./styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="./styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="./styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="./styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="./styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="./data_sources/index.html
">Data sources</a></h3><ul class="toc"><li><a href="./data_sources/dom.html
">HTML (DOM) sourced data</a></li><li><a href="./data_sources/ajax.html
">Ajax sourced data</a></li><li><a href="./data_sources/js_array.html
">Javascript sourced data</a></li><li><a href="./data_sources/server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="./api/index.html
">API</a></h3><ul class="toc"><li><a href="./api/add_row.html
">Add rows</a></li><li><a href="./api/multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="./api/multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="./api/highlight.html
">Highlighting rows and columns</a></li><li><a href="./api/row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="./api/select_row.html
">Row selection (multiple rows)</a></li><li><a href="./api/select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="./api/form.html
">Form inputs</a></li><li><a href="./api/counter_columns.html
">Index column</a></li><li><a href="./api/show_hide.html
">Show / hide columns dynamically</a></li><li><a href="./api/api_in_init.html
">Using API in callbacks</a></li><li><a href="./api/tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="./api/regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="./ajax/index.html
">Ajax</a></h3><ul class="toc"><li><a href="./ajax/simple.html
">Ajax data source (arrays)</a></li><li><a href="./ajax/objects.html
">Ajax data source (objects)</a></li><li><a href="./ajax/deep.html
">Nested object data (objects)</a></li><li><a href="./ajax/objects_subarrays.html
">Nested object data (arrays)</a></li><li><a href="./ajax/orthogonal-data.html
">Orthogonal data</a></li><li><a href="./ajax/null_data_source.html
">Generated content for a column</a></li><li><a href="./ajax/custom_data_property.html
">Custom data source property</a></li><li><a href="./ajax/custom_data_flat.html
">Flat array data source</a></li><li><a href="./ajax/defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="./server_side/index.html
">Server-side</a></h3><ul class="toc"><li><a href="./server_side/simple.html
">Server-side processing</a></li><li><a href="./server_side/custom_vars.html
">Custom HTTP variables</a></li><li><a href="./server_side/post.html
">POST data</a></li><li><a href="./server_side/ids.html
">Automatic addition of row ID attributes</a></li><li><a href="./server_side/object_data.html
">Object data source</a></li><li><a href="./server_side/row_details.html
">Row details</a></li><li><a href="./server_side/select_rows.html
">Row selection</a></li><li><a href="./server_side/jsonp.html
">JSONP data source for remote domains</a></li><li><a href="./server_side/defer_loading.html
">Deferred loading of data</a></li><li><a href="./server_side/pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="./plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="./plug-ins/api.html
">API plug-in methods</a></li><li><a href="./plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="./plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="./plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="./plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<div class="toc">
<div class="toc-group">
<h3><a href="./basic_init/index.html">Basic initialisation</a></h3>
<ul class="toc">
<li>
<a href="./basic_init/zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="./basic_init/filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="./basic_init/table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="./basic_init/multi_col_sort.html">Multi-column ordering</a>
</li>
<li>
<a href="./basic_init/multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="./basic_init/hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="./basic_init/complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="./basic_init/dom.html">DOM positioning</a>
</li>
<li>
<a href="./basic_init/flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="./basic_init/state_save.html">State saving</a>
</li>
<li>
<a href="./basic_init/alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="./basic_init/scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="./basic_init/scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="./basic_init/scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="./basic_init/scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="./basic_init/comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="./basic_init/language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./advanced_init/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="./advanced_init/events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="./advanced_init/dt_events.html">DataTables events</a>
</li>
<li>
<a href="./advanced_init/column_render.html">Column rendering</a>
</li>
<li>
<a href="./advanced_init/length_menu.html">Page length options</a>
</li>
<li>
<a href="./advanced_init/dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="./advanced_init/complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="./advanced_init/object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="./advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="./advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="./advanced_init/language_file.html">Language file</a>
</li>
<li>
<a href="./advanced_init/defaults.html">Setting defaults</a>
</li>
<li>
<a href="./advanced_init/row_callback.html">Row created callback</a>
</li>
<li>
<a href="./advanced_init/row_grouping.html">Row grouping</a>
</li>
<li>
<a href="./advanced_init/footer_callback.html">Footer callback</a>
</li>
<li>
<a href="./advanced_init/dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="./advanced_init/sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="./styling/display.html">Base style</a>
</li>
<li>
<a href="./styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="./styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="./styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="./styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="./styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="./styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="./styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="./styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="./styling/foundation.html">Foundation</a>
</li>
<li>
<a href="./styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="./styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="./styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="./styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="./styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./data_sources/index.html">Data sources</a></h3>
<ul class="toc">
<li>
<a href="./data_sources/dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="./data_sources/ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="./data_sources/js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="./data_sources/server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="./api/add_row.html">Add rows</a>
</li>
<li>
<a href="./api/multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="./api/multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="./api/highlight.html">Highlighting rows and columns</a>
</li>
<li>
<a href="./api/row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="./api/select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="./api/select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="./api/form.html">Form inputs</a>
</li>
<li>
<a href="./api/counter_columns.html">Index column</a>
</li>
<li>
<a href="./api/show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="./api/api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="./api/tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="./api/regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./ajax/index.html">Ajax</a></h3>
<ul class="toc">
<li>
<a href="./ajax/simple.html">Ajax data source (arrays)</a>
</li>
<li>
<a href="./ajax/objects.html">Ajax data source (objects)</a>
</li>
<li>
<a href="./ajax/deep.html">Nested object data (objects)</a>
</li>
<li>
<a href="./ajax/objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="./ajax/orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="./ajax/null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="./ajax/custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="./ajax/custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="./ajax/defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./server_side/index.html">Server-side</a></h3>
<ul class="toc">
<li>
<a href="./server_side/simple.html">Server-side processing</a>
</li>
<li>
<a href="./server_side/custom_vars.html">Custom HTTP variables</a>
</li>
<li>
<a href="./server_side/post.html">POST data</a>
</li>
<li>
<a href="./server_side/ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="./server_side/object_data.html">Object data source</a>
</li>
<li>
<a href="./server_side/row_details.html">Row details</a>
</li>
<li>
<a href="./server_side/select_rows.html">Row selection</a>
</li>
<li>
<a href="./server_side/jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="./server_side/defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="./server_side/pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="./plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="./plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="./plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="./plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="./plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,66 +1,54 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <title>DataTables examples - Plug-ins</title>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"> </head>
</script> <body class="dt-example">
<script type="text/javascript" language="javascript" src="../resources/demo.js"> <div class="container">
</script> <section>
<title>DataTables examples - Plug-ins</title> <h1>DataTables example <span>Plug-ins</span></h1>
</head> <div class="info">
<body class="dt-example"> <p>While DataTables has a wide range of options and data type support built in, it can never cater for every type of data out of the box. For this reason, DataTables exposes an extension API which allows you, the developers using DataTables, to add support for your own data types, searching, ordering and feature plug-ins.</p>
<div class="container">
<p>The examples in this section show how plug-ins can be used and developed for DataTables.</p>
</div>
</section>
</div>
<section> <section>
<h1>DataTables example <span>Plug-ins</span></h1> <div class="footer">
<div class="info"> <div class="gradient"></div>
<p>While DataTables has a wide range of options and data type support built in, it can never cater for every type of data out of the box. For this reason, <div class="liner">
DataTables exposes an extension API which allows you, the developers using DataTables, to add support for your own data types, searching, ordering and feature <div class="toc">
plug-ins.</p> <div class="toc-group"><h3><a href="./index.html
<p>The examples in this section show how plug-ins can be used and developed for DataTables.</p> ">Plug-ins</a></h3><ul class="toc"><li><a href="./api.html
</div> ">API plug-in methods</a></li><li><a href="./sorting_auto.html
</section> ">Ordering plug-ins (with type detection)</a></li><li><a href="./sorting_manual.html
</div> ">Ordering plug-ins (no type detection)</a></li><li><a href="./range_filtering.html
<section> ">Custom filtering - range search</a></li><li><a href="./dom_sort.html
<div class="footer"> ">Live DOM ordering</a></li></ul></div>
<div class="gradient"></div> </div>
<div class="liner">
<div class="toc"> <div class="epilogue">
<div class="toc-group"> <p>
<h3><a href="./index.html">Plug-ins</a></h3> Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
<ul class="toc"> Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
<li> </p>
<a href="./api.html">API plug-in methods</a>
</li> <p class="copyright">
<li> DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
<a href="./sorting_auto.html">Ordering plug-ins (with type detection)</a> DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</li> </p>
<li>
<a href="./sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="./range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="./dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div> </div>
</div> </div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div> </div>
</div> </section>
</section> </body>
</body>
</html> </html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -60,11 +60,6 @@
overflow: auto !important; overflow: auto !important;
font-size: 1em !important; font-size: 1em !important;
clear: both; clear: both;
box-shadow: inset 0 0 3px #555;
padding: 5px 3px;
background: #f8f8f8 !important;
box-sizing: border-box;
} }
.syntaxhighlighter.source { .syntaxhighlighter.source {
overflow: hidden !important; overflow: hidden !important;
@ -140,8 +135,8 @@
} }
.syntaxhighlighter .toolbar { .syntaxhighlighter .toolbar {
position: absolute !important; position: absolute !important;
right: 10px !important; right: 1px !important;
top: 0 !important; top: -18px !important;
font-size: 10px !important; font-size: 10px !important;
z-index: 7 !important; z-index: 7 !important;
} }
@ -249,6 +244,7 @@
* Dual licensed under the MIT and GPL licenses. * Dual licensed under the MIT and GPL licenses.
*/ */
.syntaxhighlighter { .syntaxhighlighter {
background-color: white !important;
font-size: 13px !important; font-size: 13px !important;
overflow: visible !important; overflow: visible !important;
} }
@ -273,7 +269,7 @@
color: #5C5C5C !important; color: #5C5C5C !important;
} }
.syntaxhighlighter .gutter .line.alt1, .syntaxhighlighter .gutter .line.alt2 { .syntaxhighlighter .gutter .line.alt1, .syntaxhighlighter .gutter .line.alt2 {
background-color: transparent !important; background-color: white !important;
} }
.odd .syntaxhighlighter .gutter .line.alt1, .odd .syntaxhighlighter .gutter .line.alt2 { .odd .syntaxhighlighter .gutter .line.alt1, .odd .syntaxhighlighter .gutter .line.alt2 {
background-color: #F2F2F2 !important; background-color: #F2F2F2 !important;

View File

@ -1,26 +1,19 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<title>DataTables example - Custom HTTP variables</title>
<link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"> <title>DataTables example - Custom HTTP variables</title>
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"><link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<style type="text/css" class="init"> <style type="text/css" class="init">
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <script type="text/javascript" language="javascript" class="init">
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() { $(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
"processing": true, "processing": true,
@ -36,56 +29,39 @@ $(document).ready(function() {
} ); } );
} ); } );
</script> </script>
</head> </head>
<body class="dt-example"> <body class="dt-example ">
<div class="container"> <div class="container">
<section> <section>
<h1>DataTables example <span>Custom HTTP variables</span></h1> <h1>DataTables example <span>Custom HTTP variables</span></h1>
<div class="info"> <div class="info">
<p>It can often be useful to send extra information to the server when utilising DataTables' server-side processing option. This is done by using the <a href= <p>It can often be useful to send extra information to the server when utilising DataTables' server-side processing option. This is done by using the <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> option's <code>data</code> parameter which can be used in one of two different ways:</p>
"//datatables.net/reference/option/ajax.data"><code class="option" title="DataTables initialisation option">ajax.data</code></a> option which can be used in one of
two different ways:</p> <ul class="markdown">
<ul class="markdown"> <li><code>object</code> - An object data to send to the server. This is useful for adding static data to the request.</li>
<li><code>object</code> - An object data to send to the server. This is useful for adding static data to the request.</li> <li><code>function</code> - A function which will manipulate the data object to send to the server, adding values as required. Using the <code>data</code> parameter as a function allows the additional data to evaluated and added to the request at the time the request is made.</li>
<li><code>function</code> - A function which will manipulate the data object to send to the server, adding values as required. Using the <code>data</code> </ul>
parameter as a function allows the additional data to evaluated and added to the request at the time the request is made.</li>
<p>The example below shows server-side processing being used with an extra parameter being sent to the server by using the <code>ajax.data</code> option as a function.</p>
</div>
<table id="example" class="display" cellspacing="0" width="100%"><thead><tr><th>First name</th><th>Last name</th><th>Position</th><th>Office</th><th>Start date</th><th>Salary</th></tr></thead><tfoot><tr><th>First name</th><th>Last name</th><th>Position</th><th>Office</th><th>Start date</th><th>Salary</th></tr></tfoot></table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul> </ul>
<p>The example below shows server-side processing being used with an extra parameter being sent to the server by using the <code>ajax.data</code> option as a
function.</p> <div class="tabs">
</div> <div class="js">
<table id="example" class="display" cellspacing="0" width="100%"> <p>The Javascript shown below is used to initialise the table shown in this example:</p>
<thead> <code class="multiline language-js">$(document).ready(function() {
<tr>
<th>First name</th>
<th>Last name</th>
<th>Position</th>
<th>Office</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tfoot>
<tr>
<th>First name</th>
<th>Last name</th>
<th>Position</th>
<th>Office</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
&quot;processing&quot;: true, &quot;processing&quot;: true,
&quot;serverSide&quot;: true, &quot;serverSide&quot;: true,
@ -99,366 +75,153 @@ $(document).ready(function() {
} }
} ); } );
} );</code> } );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul> <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<li> <ul><li><a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a></li><li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li></ul>
<a href="//code.jquery.com/jquery-1.12.3.js">//code.jquery.com/jquery-1.12.3.js</a> </div>
</li> <div class="table">
<li> <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
<a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a> </div>
</li> <div class="css">
</ul> <div>
</div> <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 additional CSS used is shown below:</p>
<div class="table"> <code class="multiline language-css"></code>
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p> </div>
</div>
<div class="css"> <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<div> <ul><li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li></ul>
<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 </div>
additional CSS used is shown below:</p><code class="multiline language-css"></code> <div class="ajax">
<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 loaded.</p>
</div>
<div class="php">
<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 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables documentation</a>.</p>
</div> </div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a>
</li>
</ul>
</div> </div>
<div class="ajax"> </section>
<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
loaded.</p>
</div> </div>
<div class="php">
<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 <section>
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables <div class="footer">
documentation</a>.</p> <div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group"><h3><a href="../basic_init/index.html
">Basic initialisation</a></h3><ul class="toc"><li><a href="../basic_init/zero_configuration.html
">Zero configuration</a></li><li><a href="../basic_init/filter_only.html
">Feature enable / disable</a></li><li><a href="../basic_init/table_sorting.html
">Default ordering (sorting)</a></li><li><a href="../basic_init/multi_col_sort.html
">Multi-column ordering</a></li><li><a href="../basic_init/multiple_tables.html
">Multiple tables</a></li><li><a href="../basic_init/hidden_columns.html
">Hidden columns</a></li><li><a href="../basic_init/complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="../basic_init/dom.html
">DOM positioning</a></li><li><a href="../basic_init/flexible_width.html
">Flexible table width</a></li><li><a href="../basic_init/state_save.html
">State saving</a></li><li><a href="../basic_init/alt_pagination.html
">Alternative pagination</a></li><li><a href="../basic_init/scroll_y.html
">Scroll - vertical</a></li><li><a href="../basic_init/scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="../basic_init/scroll_x.html
">Scroll - horizontal</a></li><li><a href="../basic_init/scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="../basic_init/comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="../basic_init/language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="../advanced_init/index.html
">Advanced initialisation</a></h3><ul class="toc"><li><a href="../advanced_init/events_live.html
">DOM / jQuery events</a></li><li><a href="../advanced_init/dt_events.html
">DataTables events</a></li><li><a href="../advanced_init/column_render.html
">Column rendering</a></li><li><a href="../advanced_init/length_menu.html
">Page length options</a></li><li><a href="../advanced_init/dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="../advanced_init/complex_header.html
">Complex headers with column visibility</a></li><li><a href="../advanced_init/object_dom_read.html
">Read HTML to data objects</a></li><li><a href="../advanced_init/html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="../advanced_init/html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="../advanced_init/language_file.html
">Language file</a></li><li><a href="../advanced_init/defaults.html
">Setting defaults</a></li><li><a href="../advanced_init/row_callback.html
">Row created callback</a></li><li><a href="../advanced_init/row_grouping.html
">Row grouping</a></li><li><a href="../advanced_init/footer_callback.html
">Footer callback</a></li><li><a href="../advanced_init/dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="../advanced_init/sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="../styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="../styling/display.html
">Base style</a></li><li><a href="../styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="../styling/cell-border.html
">Base style - cell borders</a></li><li><a href="../styling/compact.html
">Base style - compact</a></li><li><a href="../styling/hover.html
">Base style - hover</a></li><li><a href="../styling/order-column.html
">Base style - order-column</a></li><li><a href="../styling/row-border.html
">Base style - row borders</a></li><li><a href="../styling/stripe.html
">Base style - stripe</a></li><li><a href="../styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="../styling/foundation.html
">Foundation</a></li><li><a href="../styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="../styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="../styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="../styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="../styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="../data_sources/index.html
">Data sources</a></h3><ul class="toc"><li><a href="../data_sources/dom.html
">HTML (DOM) sourced data</a></li><li><a href="../data_sources/ajax.html
">Ajax sourced data</a></li><li><a href="../data_sources/js_array.html
">Javascript sourced data</a></li><li><a href="../data_sources/server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="../api/index.html
">API</a></h3><ul class="toc"><li><a href="../api/add_row.html
">Add rows</a></li><li><a href="../api/multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="../api/multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="../api/highlight.html
">Highlighting rows and columns</a></li><li><a href="../api/row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="../api/select_row.html
">Row selection (multiple rows)</a></li><li><a href="../api/select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="../api/form.html
">Form inputs</a></li><li><a href="../api/counter_columns.html
">Index column</a></li><li><a href="../api/show_hide.html
">Show / hide columns dynamically</a></li><li><a href="../api/api_in_init.html
">Using API in callbacks</a></li><li><a href="../api/tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="../api/regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="../ajax/index.html
">Ajax</a></h3><ul class="toc"><li><a href="../ajax/simple.html
">Ajax data source (arrays)</a></li><li><a href="../ajax/objects.html
">Ajax data source (objects)</a></li><li><a href="../ajax/deep.html
">Nested object data (objects)</a></li><li><a href="../ajax/objects_subarrays.html
">Nested object data (arrays)</a></li><li><a href="../ajax/orthogonal-data.html
">Orthogonal data</a></li><li><a href="../ajax/null_data_source.html
">Generated content for a column</a></li><li><a href="../ajax/custom_data_property.html
">Custom data source property</a></li><li><a href="../ajax/custom_data_flat.html
">Flat array data source</a></li><li><a href="../ajax/defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="./index.html
">Server-side</a></h3><ul class="toc active"><li><a href="./simple.html
">Server-side processing</a></li><li class="active"><a href="./custom_vars.html
">Custom HTTP variables</a></li><li><a href="./post.html
">POST data</a></li><li><a href="./ids.html
">Automatic addition of row ID attributes</a></li><li><a href="./object_data.html
">Object data source</a></li><li><a href="./row_details.html
">Row details</a></li><li><a href="./select_rows.html
">Row selection</a></li><li><a href="./jsonp.html
">JSONP data source for remote domains</a></li><li><a href="./defer_loading.html
">Deferred loading of data</a></li><li><a href="./pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="../plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="../plug-ins/api.html
">API plug-in methods</a></li><li><a href="../plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="../plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="../plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="../plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div> </div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="../basic_init/index.html">Basic initialisation</a></h3>
<ul class="toc">
<li>
<a href="../basic_init/zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="../basic_init/filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="../basic_init/table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="../basic_init/multi_col_sort.html">Multi-column ordering</a>
</li>
<li>
<a href="../basic_init/multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="../basic_init/hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="../basic_init/complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="../basic_init/dom.html">DOM positioning</a>
</li>
<li>
<a href="../basic_init/flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="../basic_init/state_save.html">State saving</a>
</li>
<li>
<a href="../basic_init/alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="../basic_init/scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="../basic_init/scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="../basic_init/scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="../basic_init/scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="../basic_init/comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="../basic_init/language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../advanced_init/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="../advanced_init/events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="../advanced_init/dt_events.html">DataTables events</a>
</li>
<li>
<a href="../advanced_init/column_render.html">Column rendering</a>
</li>
<li>
<a href="../advanced_init/length_menu.html">Page length options</a>
</li>
<li>
<a href="../advanced_init/dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="../advanced_init/complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="../advanced_init/object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="../advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="../advanced_init/language_file.html">Language file</a>
</li>
<li>
<a href="../advanced_init/defaults.html">Setting defaults</a>
</li>
<li>
<a href="../advanced_init/row_callback.html">Row created callback</a>
</li>
<li>
<a href="../advanced_init/row_grouping.html">Row grouping</a>
</li>
<li>
<a href="../advanced_init/footer_callback.html">Footer callback</a>
</li>
<li>
<a href="../advanced_init/dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="../advanced_init/sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/display.html">Base style</a>
</li>
<li>
<a href="../styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="../styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="../styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="../styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="../styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="../styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="../styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="../styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="../styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../data_sources/index.html">Data sources</a></h3>
<ul class="toc">
<li>
<a href="../data_sources/dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="../data_sources/ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="../data_sources/js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="../data_sources/server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="../api/add_row.html">Add rows</a>
</li>
<li>
<a href="../api/multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="../api/multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="../api/highlight.html">Highlighting rows and columns</a>
</li>
<li>
<a href="../api/row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="../api/select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="../api/select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="../api/form.html">Form inputs</a>
</li>
<li>
<a href="../api/counter_columns.html">Index column</a>
</li>
<li>
<a href="../api/show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="../api/api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="../api/tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="../api/regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../ajax/index.html">Ajax</a></h3>
<ul class="toc">
<li>
<a href="../ajax/simple.html">Ajax data source (arrays)</a>
</li>
<li>
<a href="../ajax/objects.html">Ajax data source (objects)</a>
</li>
<li>
<a href="../ajax/deep.html">Nested object data (objects)</a>
</li>
<li>
<a href="../ajax/objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="../ajax/orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="../ajax/null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="../ajax/custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="../ajax/custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="../ajax/defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./index.html">Server-side</a></h3>
<ul class="toc active">
<li>
<a href="./simple.html">Server-side processing</a>
</li>
<li class="active">
<a href="./custom_vars.html">Custom HTTP variables</a>
</li>
<li>
<a href="./post.html">POST data</a>
</li>
<li>
<a href="./ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="./object_data.html">Object data source</a>
</li>
<li>
<a href="./row_details.html">Row details</a>
</li>
<li>
<a href="./select_rows.html">Row selection</a>
</li>
<li>
<a href="./jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="./defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="./pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="../plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="../plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

View File

@ -1,26 +1,19 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<title>DataTables example - Deferred loading of data</title>
<link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"> <title>DataTables example - Deferred loading of data</title>
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"><link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<style type="text/css" class="init"> <style type="text/css" class="init">
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <script type="text/javascript" language="javascript" class="init">
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() { $(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
"processing": true, "processing": true,
@ -30,136 +23,115 @@ $(document).ready(function() {
} ); } );
} ); } );
</script> </script>
</head> </head>
<body class="dt-example"> <body class="dt-example ">
<div class="container"> <div class="container">
<section> <section>
<h1>DataTables example <span>Deferred loading of data</span></h1> <h1>DataTables example <span>Deferred loading of data</span></h1>
<div class="info"> <div class="info">
<p>When using DataTables with server-side processing, the default behaviour is to have DataTables automatically make an Ajax call and load the data, removing <p>When using DataTables with server-side processing, the default behaviour is to have DataTables automatically make an Ajax call and load the data, removing anything which might have already been in the table. However, this behaviour might not always be desirable when the first page of the table has already been preloaded in the HTML (which you might do to ensure accessibility or for performance reasons).</p>
anything which might have already been in the table. However, this behaviour might not always be desirable when the first page of the table has already been
preloaded in the HTML (which you might do to ensure accessibility or for performance reasons).</p> <p>This automatic Ajax call to get the first page of data can be overridden by using the <a href="//datatables.net/reference/option/deferLoading"><code class="option" title="DataTables initialisation option">deferLoading</code></a> initialisation property. It serves two purposes, firstly to indicate that deferred loading is required, but also to tell DataTables how many records there are in the full table, in this case 57 (this allows the information element and pagination to be displayed correctly).</p>
<p>This automatic Ajax call to get the first page of data can be overridden by using the <a href="//datatables.net/reference/option/deferLoading"><code class=
"option" title="DataTables initialisation option">deferLoading</code></a> initialisation property. It serves two purposes, firstly to indicate that deferred <p>In the example below, the HTML page already has the first 10 rows of data available it in, so we use <a href="//datatables.net/reference/option/deferLoading"><code class="option" title="DataTables initialisation option">deferLoading</code></a> to tell DataTables that this data is available and that it should wait for under interaction (ordering, paging etc) before making an Ajax call.</p>
loading is required, but also to tell DataTables how many records there are in the full table, in this case 57 (this allows the information element and pagination
to be displayed correctly).</p> </div>
<p>In the example below, the HTML page already has the first 10 rows of data available it in, so we use <a href=
"//datatables.net/reference/option/deferLoading"><code class="option" title="DataTables initialisation option">deferLoading</code></a> to tell DataTables that this
data is available and that it should wait for under interaction (ordering, paging etc) before making an Ajax call.</p> <table id="example" class="display" cellspacing="0" width="100%"><thead><tr><th>First name</th><th>Last name</th><th>Position</th><th>Office</th><th>Start date</th><th>Salary</th></tr></thead><tfoot><tr><th>First name</th><th>Last name</th><th>Position</th><th>Office</th><th>Start date</th><th>Salary</th></tr></tfoot><tr class="odd">
</div> <td>Airi</td>
<table id="example" class="display" cellspacing="0" width="100%"> <td>Satou</td>
<thead> <td>Accountant</td>
<tr> <td>Tokyo</td>
<th>First name</th> <td>28th Nov 08</td>
<th>Last name</th> <td>$162,700</td>
<th>Position</th> </tr>
<th>Office</th> <tr class="even">
<th>Start date</th> <td>Angelica</td>
<th>Salary</th> <td>Ramos</td>
</tr> <td>Chief Executive Officer (CEO)</td>
</thead> <td>London</td>
<tfoot> <td>9th Oct 09</td>
<tr> <td>$1,200,000</td>
<th>First name</th> </tr>
<th>Last name</th> <tr class="odd">
<th>Position</th> <td>Ashton</td>
<th>Office</th> <td>Cox</td>
<th>Start date</th> <td>Junior Technical Author</td>
<th>Salary</th> <td>San Francisco</td>
</tr> <td>12th Jan 09</td>
</tfoot> <td>$86,000</td>
<tr class="odd"> </tr>
<td>Airi</td> <tr class="even">
<td>Satou</td> <td>Bradley</td>
<td>Accountant</td> <td>Greer</td>
<td>Tokyo</td> <td>Software Engineer</td>
<td>28th Nov 08</td> <td>London</td>
<td>$162,700</td> <td>13th Oct 12</td>
</tr> <td>$132,000</td>
<tr class="even"> </tr>
<td>Angelica</td> <tr class="odd">
<td>Ramos</td> <td>Brenden</td>
<td>Chief Executive Officer (CEO)</td> <td>Wagner</td>
<td>London</td> <td>Software Engineer</td>
<td>9th Oct 09</td> <td>San Francisco</td>
<td>$1,200,000</td> <td>7th Jun 11</td>
</tr> <td>$206,850</td>
<tr class="odd"> </tr>
<td>Ashton</td> <tr class="even">
<td>Cox</td> <td>Brielle</td>
<td>Junior Technical Author</td> <td>Williamson</td>
<td>San Francisco</td> <td>Integration Specialist</td>
<td>12th Jan 09</td> <td>New York</td>
<td>$86,000</td> <td>2nd Dec 12</td>
</tr> <td>$372,000</td>
<tr class="even"> </tr>
<td>Bradley</td> <tr class="odd">
<td>Greer</td> <td>Bruno</td>
<td>Software Engineer</td> <td>Nash</td>
<td>London</td> <td>Software Engineer</td>
<td>13th Oct 12</td> <td>London</td>
<td>$132,000</td> <td>3rd May 11</td>
</tr> <td>$163,500</td>
<tr class="odd"> </tr>
<td>Brenden</td> <tr class="even">
<td>Wagner</td> <td>Caesar</td>
<td>Software Engineer</td> <td>Vance</td>
<td>San Francisco</td> <td>Pre-Sales Support</td>
<td>7th Jun 11</td> <td>New York</td>
<td>$206,850</td> <td>12th Dec 11</td>
</tr> <td>$106,450</td>
<tr class="even"> </tr>
<td>Brielle</td> <tr class="odd">
<td>Williamson</td> <td>Cara</td>
<td>Integration Specialist</td> <td>Stevens</td>
<td>New York</td> <td>Sales Assistant</td>
<td>2nd Dec 12</td> <td>New York</td>
<td>$372,000</td> <td>6th Dec 11</td>
</tr> <td>$145,600</td>
<tr class="odd"> </tr>
<td>Bruno</td> <tr class="even">
<td>Nash</td> <td>Cedric</td>
<td>Software Engineer</td> <td>Kelly</td>
<td>London</td> <td>Senior Javascript Developer</td>
<td>3rd May 11</td> <td>Edinburgh</td>
<td>$163,500</td> <td>29th Mar 12</td>
</tr> <td>$433,060</td>
<tr class="even"> </tr></table>
<td>Caesar</td>
<td>Vance</td> <ul class="tabs">
<td>Pre-Sales Support</td> <li class="active">Javascript</li>
<td>New York</td> <li>HTML</li>
<td>12th Dec 11</td> <li>CSS</li>
<td>$106,450</td> <li>Ajax</li>
</tr> <li>Server-side script</li>
<tr class="odd"> </ul>
<td>Cara</td>
<td>Stevens</td> <div class="tabs">
<td>Sales Assistant</td> <div class="js">
<td>New York</td> <p>The Javascript shown below is used to initialise the table shown in this example:</p>
<td>6th Dec 11</td> <code class="multiline language-js">$(document).ready(function() {
<td>$145,600</td>
</tr>
<tr class="even">
<td>Cedric</td>
<td>Kelly</td>
<td>Senior Javascript Developer</td>
<td>Edinburgh</td>
<td>29th Mar 12</td>
<td>$433,060</td>
</tr>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
&quot;processing&quot;: true, &quot;processing&quot;: true,
&quot;serverSide&quot;: true, &quot;serverSide&quot;: true,
@ -167,366 +139,153 @@ $(document).ready(function() {
&quot;deferLoading&quot;: 57 &quot;deferLoading&quot;: 57
} ); } );
} );</code> } );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul> <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<li> <ul><li><a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a></li><li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li></ul>
<a href="//code.jquery.com/jquery-1.12.3.js">//code.jquery.com/jquery-1.12.3.js</a> </div>
</li> <div class="table">
<li> <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
<a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a> </div>
</li> <div class="css">
</ul> <div>
</div> <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 additional CSS used is shown below:</p>
<div class="table"> <code class="multiline language-css"></code>
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p> </div>
</div>
<div class="css"> <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<div> <ul><li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li></ul>
<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 </div>
additional CSS used is shown below:</p><code class="multiline language-css"></code> <div class="ajax">
<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 loaded.</p>
</div>
<div class="php">
<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 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables documentation</a>.</p>
</div> </div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a>
</li>
</ul>
</div> </div>
<div class="ajax"> </section>
<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
loaded.</p>
</div> </div>
<div class="php">
<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 <section>
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables <div class="footer">
documentation</a>.</p> <div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group"><h3><a href="../basic_init/index.html
">Basic initialisation</a></h3><ul class="toc"><li><a href="../basic_init/zero_configuration.html
">Zero configuration</a></li><li><a href="../basic_init/filter_only.html
">Feature enable / disable</a></li><li><a href="../basic_init/table_sorting.html
">Default ordering (sorting)</a></li><li><a href="../basic_init/multi_col_sort.html
">Multi-column ordering</a></li><li><a href="../basic_init/multiple_tables.html
">Multiple tables</a></li><li><a href="../basic_init/hidden_columns.html
">Hidden columns</a></li><li><a href="../basic_init/complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="../basic_init/dom.html
">DOM positioning</a></li><li><a href="../basic_init/flexible_width.html
">Flexible table width</a></li><li><a href="../basic_init/state_save.html
">State saving</a></li><li><a href="../basic_init/alt_pagination.html
">Alternative pagination</a></li><li><a href="../basic_init/scroll_y.html
">Scroll - vertical</a></li><li><a href="../basic_init/scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="../basic_init/scroll_x.html
">Scroll - horizontal</a></li><li><a href="../basic_init/scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="../basic_init/comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="../basic_init/language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="../advanced_init/index.html
">Advanced initialisation</a></h3><ul class="toc"><li><a href="../advanced_init/events_live.html
">DOM / jQuery events</a></li><li><a href="../advanced_init/dt_events.html
">DataTables events</a></li><li><a href="../advanced_init/column_render.html
">Column rendering</a></li><li><a href="../advanced_init/length_menu.html
">Page length options</a></li><li><a href="../advanced_init/dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="../advanced_init/complex_header.html
">Complex headers with column visibility</a></li><li><a href="../advanced_init/object_dom_read.html
">Read HTML to data objects</a></li><li><a href="../advanced_init/html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="../advanced_init/html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="../advanced_init/language_file.html
">Language file</a></li><li><a href="../advanced_init/defaults.html
">Setting defaults</a></li><li><a href="../advanced_init/row_callback.html
">Row created callback</a></li><li><a href="../advanced_init/row_grouping.html
">Row grouping</a></li><li><a href="../advanced_init/footer_callback.html
">Footer callback</a></li><li><a href="../advanced_init/dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="../advanced_init/sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="../styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="../styling/display.html
">Base style</a></li><li><a href="../styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="../styling/cell-border.html
">Base style - cell borders</a></li><li><a href="../styling/compact.html
">Base style - compact</a></li><li><a href="../styling/hover.html
">Base style - hover</a></li><li><a href="../styling/order-column.html
">Base style - order-column</a></li><li><a href="../styling/row-border.html
">Base style - row borders</a></li><li><a href="../styling/stripe.html
">Base style - stripe</a></li><li><a href="../styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="../styling/foundation.html
">Foundation</a></li><li><a href="../styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="../styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="../styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="../styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="../styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="../data_sources/index.html
">Data sources</a></h3><ul class="toc"><li><a href="../data_sources/dom.html
">HTML (DOM) sourced data</a></li><li><a href="../data_sources/ajax.html
">Ajax sourced data</a></li><li><a href="../data_sources/js_array.html
">Javascript sourced data</a></li><li><a href="../data_sources/server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="../api/index.html
">API</a></h3><ul class="toc"><li><a href="../api/add_row.html
">Add rows</a></li><li><a href="../api/multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="../api/multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="../api/highlight.html
">Highlighting rows and columns</a></li><li><a href="../api/row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="../api/select_row.html
">Row selection (multiple rows)</a></li><li><a href="../api/select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="../api/form.html
">Form inputs</a></li><li><a href="../api/counter_columns.html
">Index column</a></li><li><a href="../api/show_hide.html
">Show / hide columns dynamically</a></li><li><a href="../api/api_in_init.html
">Using API in callbacks</a></li><li><a href="../api/tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="../api/regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="../ajax/index.html
">Ajax</a></h3><ul class="toc"><li><a href="../ajax/simple.html
">Ajax data source (arrays)</a></li><li><a href="../ajax/objects.html
">Ajax data source (objects)</a></li><li><a href="../ajax/deep.html
">Nested object data (objects)</a></li><li><a href="../ajax/objects_subarrays.html
">Nested object data (arrays)</a></li><li><a href="../ajax/orthogonal-data.html
">Orthogonal data</a></li><li><a href="../ajax/null_data_source.html
">Generated content for a column</a></li><li><a href="../ajax/custom_data_property.html
">Custom data source property</a></li><li><a href="../ajax/custom_data_flat.html
">Flat array data source</a></li><li><a href="../ajax/defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="./index.html
">Server-side</a></h3><ul class="toc active"><li><a href="./simple.html
">Server-side processing</a></li><li><a href="./custom_vars.html
">Custom HTTP variables</a></li><li><a href="./post.html
">POST data</a></li><li><a href="./ids.html
">Automatic addition of row ID attributes</a></li><li><a href="./object_data.html
">Object data source</a></li><li><a href="./row_details.html
">Row details</a></li><li><a href="./select_rows.html
">Row selection</a></li><li><a href="./jsonp.html
">JSONP data source for remote domains</a></li><li class="active"><a href="./defer_loading.html
">Deferred loading of data</a></li><li><a href="./pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="../plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="../plug-ins/api.html
">API plug-in methods</a></li><li><a href="../plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="../plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="../plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="../plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div> </div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="../basic_init/index.html">Basic initialisation</a></h3>
<ul class="toc">
<li>
<a href="../basic_init/zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="../basic_init/filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="../basic_init/table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="../basic_init/multi_col_sort.html">Multi-column ordering</a>
</li>
<li>
<a href="../basic_init/multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="../basic_init/hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="../basic_init/complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="../basic_init/dom.html">DOM positioning</a>
</li>
<li>
<a href="../basic_init/flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="../basic_init/state_save.html">State saving</a>
</li>
<li>
<a href="../basic_init/alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="../basic_init/scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="../basic_init/scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="../basic_init/scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="../basic_init/scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="../basic_init/comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="../basic_init/language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../advanced_init/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="../advanced_init/events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="../advanced_init/dt_events.html">DataTables events</a>
</li>
<li>
<a href="../advanced_init/column_render.html">Column rendering</a>
</li>
<li>
<a href="../advanced_init/length_menu.html">Page length options</a>
</li>
<li>
<a href="../advanced_init/dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="../advanced_init/complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="../advanced_init/object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="../advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="../advanced_init/language_file.html">Language file</a>
</li>
<li>
<a href="../advanced_init/defaults.html">Setting defaults</a>
</li>
<li>
<a href="../advanced_init/row_callback.html">Row created callback</a>
</li>
<li>
<a href="../advanced_init/row_grouping.html">Row grouping</a>
</li>
<li>
<a href="../advanced_init/footer_callback.html">Footer callback</a>
</li>
<li>
<a href="../advanced_init/dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="../advanced_init/sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/display.html">Base style</a>
</li>
<li>
<a href="../styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="../styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="../styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="../styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="../styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="../styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="../styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="../styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="../styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../data_sources/index.html">Data sources</a></h3>
<ul class="toc">
<li>
<a href="../data_sources/dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="../data_sources/ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="../data_sources/js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="../data_sources/server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="../api/add_row.html">Add rows</a>
</li>
<li>
<a href="../api/multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="../api/multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="../api/highlight.html">Highlighting rows and columns</a>
</li>
<li>
<a href="../api/row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="../api/select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="../api/select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="../api/form.html">Form inputs</a>
</li>
<li>
<a href="../api/counter_columns.html">Index column</a>
</li>
<li>
<a href="../api/show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="../api/api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="../api/tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="../api/regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../ajax/index.html">Ajax</a></h3>
<ul class="toc">
<li>
<a href="../ajax/simple.html">Ajax data source (arrays)</a>
</li>
<li>
<a href="../ajax/objects.html">Ajax data source (objects)</a>
</li>
<li>
<a href="../ajax/deep.html">Nested object data (objects)</a>
</li>
<li>
<a href="../ajax/objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="../ajax/orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="../ajax/null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="../ajax/custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="../ajax/custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="../ajax/defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./index.html">Server-side</a></h3>
<ul class="toc active">
<li>
<a href="./simple.html">Server-side processing</a>
</li>
<li>
<a href="./custom_vars.html">Custom HTTP variables</a>
</li>
<li>
<a href="./post.html">POST data</a>
</li>
<li>
<a href="./ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="./object_data.html">Object data source</a>
</li>
<li>
<a href="./row_details.html">Row details</a>
</li>
<li>
<a href="./select_rows.html">Row selection</a>
</li>
<li>
<a href="./jsonp.html">JSONP data source for remote domains</a>
</li>
<li class="active">
<a href="./defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="./pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="../plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="../plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

View File

@ -1,26 +1,19 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<title>DataTables example - Automatic addition of row ID attributes</title>
<link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"> <title>DataTables example - Automatic addition of row ID attributes</title>
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"><link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<style type="text/css" class="init"> <style type="text/css" class="init">
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <script type="text/javascript" language="javascript" class="init">
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() { $(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
"processing": true, "processing": true,
@ -37,53 +30,36 @@ $(document).ready(function() {
} ); } );
} ); } );
</script> </script>
</head> </head>
<body class="dt-example"> <body class="dt-example ">
<div class="container"> <div class="container">
<section> <section>
<h1>DataTables example <span>Automatic addition of row ID attributes</span></h1> <h1>DataTables example <span>Automatic addition of row ID attributes</span></h1>
<div class="info"> <div class="info">
<p>Often when using server-side processing you will find that it can be useful to have a specific ID on each row (the primary key value from the database for <p>Often when using server-side processing you will find that it can be useful to have a specific ID on each row (the primary key value from the database for example). By assigning the ID you want to apply to each row using the property <code>DT_RowId</code> of the data source object for each row (this property name can be configured using the <a href="//datatables.net/reference/option/rowId"><code class="option" title="DataTables initialisation option">rowId</code></a> option), DataTables will automatically add it for you (note that this will work for Ajax and Javascript loaded data as well as for server-side processing).</p>
example). By assigning the ID you want to apply to each row using the property <code>DT_RowId</code> of the data source object for each row (this property name can
be configured using the <a href="//datatables.net/reference/option/rowId"><code class="option" title="DataTables initialisation option">rowId</code></a> option), <p>In addition to <code>DT_RowId</code> there are other properties which perform similar actions - please refer to the <a href="https://datatables.net/manual/server-side">server-side processing section of the manual</a> for full details.</p>
DataTables will automatically add it for you (note that this will work for Ajax and Javascript loaded data as well as for server-side processing).</p>
<p>In addition to <code>DT_RowId</code> there are other properties which perform similar actions - please refer to the <a href= <p>This example below shows <code>DT_RowId</code> being used to add information to the table. In addition objects are used as the data source for the rows.</p>
"https://datatables.net/manual/server-side">server-side processing section of the manual</a> for full details.</p>
<p>This example below shows <code>DT_RowId</code> being used to add information to the table. In addition objects are used as the data source for the rows.</p> </div>
</div>
<table id="example" class="display" cellspacing="0" width="100%">
<thead> <table id="example" class="display" cellspacing="0" width="100%"><thead><tr><th>First name</th><th>Last name</th><th>Position</th><th>Office</th><th>Start date</th><th>Salary</th></tr></thead><tfoot><tr><th>First name</th><th>Last name</th><th>Position</th><th>Office</th><th>Start date</th><th>Salary</th></tr></tfoot></table>
<tr>
<th>First name</th> <ul class="tabs">
<th>Last name</th> <li class="active">Javascript</li>
<th>Position</th> <li>HTML</li>
<th>Office</th> <li>CSS</li>
<th>Start date</th> <li>Ajax</li>
<th>Salary</th> <li>Server-side script</li>
</tr> </ul>
</thead>
<tfoot> <div class="tabs">
<tr> <div class="js">
<th>First name</th> <p>The Javascript shown below is used to initialise the table shown in this example:</p>
<th>Last name</th> <code class="multiline language-js">$(document).ready(function() {
<th>Position</th>
<th>Office</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
&quot;processing&quot;: true, &quot;processing&quot;: true,
&quot;serverSide&quot;: true, &quot;serverSide&quot;: true,
@ -98,366 +74,153 @@ $(document).ready(function() {
] ]
} ); } );
} );</code> } );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul> <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<li> <ul><li><a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a></li><li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li></ul>
<a href="//code.jquery.com/jquery-1.12.3.js">//code.jquery.com/jquery-1.12.3.js</a> </div>
</li> <div class="table">
<li> <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
<a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a> </div>
</li> <div class="css">
</ul> <div>
</div> <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 additional CSS used is shown below:</p>
<div class="table"> <code class="multiline language-css"></code>
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p> </div>
</div>
<div class="css"> <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<div> <ul><li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li></ul>
<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 </div>
additional CSS used is shown below:</p><code class="multiline language-css"></code> <div class="ajax">
<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 loaded.</p>
</div>
<div class="php">
<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 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables documentation</a>.</p>
</div> </div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a>
</li>
</ul>
</div> </div>
<div class="ajax"> </section>
<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
loaded.</p>
</div> </div>
<div class="php">
<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 <section>
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables <div class="footer">
documentation</a>.</p> <div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group"><h3><a href="../basic_init/index.html
">Basic initialisation</a></h3><ul class="toc"><li><a href="../basic_init/zero_configuration.html
">Zero configuration</a></li><li><a href="../basic_init/filter_only.html
">Feature enable / disable</a></li><li><a href="../basic_init/table_sorting.html
">Default ordering (sorting)</a></li><li><a href="../basic_init/multi_col_sort.html
">Multi-column ordering</a></li><li><a href="../basic_init/multiple_tables.html
">Multiple tables</a></li><li><a href="../basic_init/hidden_columns.html
">Hidden columns</a></li><li><a href="../basic_init/complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="../basic_init/dom.html
">DOM positioning</a></li><li><a href="../basic_init/flexible_width.html
">Flexible table width</a></li><li><a href="../basic_init/state_save.html
">State saving</a></li><li><a href="../basic_init/alt_pagination.html
">Alternative pagination</a></li><li><a href="../basic_init/scroll_y.html
">Scroll - vertical</a></li><li><a href="../basic_init/scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="../basic_init/scroll_x.html
">Scroll - horizontal</a></li><li><a href="../basic_init/scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="../basic_init/comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="../basic_init/language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="../advanced_init/index.html
">Advanced initialisation</a></h3><ul class="toc"><li><a href="../advanced_init/events_live.html
">DOM / jQuery events</a></li><li><a href="../advanced_init/dt_events.html
">DataTables events</a></li><li><a href="../advanced_init/column_render.html
">Column rendering</a></li><li><a href="../advanced_init/length_menu.html
">Page length options</a></li><li><a href="../advanced_init/dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="../advanced_init/complex_header.html
">Complex headers with column visibility</a></li><li><a href="../advanced_init/object_dom_read.html
">Read HTML to data objects</a></li><li><a href="../advanced_init/html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="../advanced_init/html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="../advanced_init/language_file.html
">Language file</a></li><li><a href="../advanced_init/defaults.html
">Setting defaults</a></li><li><a href="../advanced_init/row_callback.html
">Row created callback</a></li><li><a href="../advanced_init/row_grouping.html
">Row grouping</a></li><li><a href="../advanced_init/footer_callback.html
">Footer callback</a></li><li><a href="../advanced_init/dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="../advanced_init/sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="../styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="../styling/display.html
">Base style</a></li><li><a href="../styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="../styling/cell-border.html
">Base style - cell borders</a></li><li><a href="../styling/compact.html
">Base style - compact</a></li><li><a href="../styling/hover.html
">Base style - hover</a></li><li><a href="../styling/order-column.html
">Base style - order-column</a></li><li><a href="../styling/row-border.html
">Base style - row borders</a></li><li><a href="../styling/stripe.html
">Base style - stripe</a></li><li><a href="../styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="../styling/foundation.html
">Foundation</a></li><li><a href="../styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="../styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="../styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="../styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="../styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="../data_sources/index.html
">Data sources</a></h3><ul class="toc"><li><a href="../data_sources/dom.html
">HTML (DOM) sourced data</a></li><li><a href="../data_sources/ajax.html
">Ajax sourced data</a></li><li><a href="../data_sources/js_array.html
">Javascript sourced data</a></li><li><a href="../data_sources/server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="../api/index.html
">API</a></h3><ul class="toc"><li><a href="../api/add_row.html
">Add rows</a></li><li><a href="../api/multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="../api/multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="../api/highlight.html
">Highlighting rows and columns</a></li><li><a href="../api/row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="../api/select_row.html
">Row selection (multiple rows)</a></li><li><a href="../api/select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="../api/form.html
">Form inputs</a></li><li><a href="../api/counter_columns.html
">Index column</a></li><li><a href="../api/show_hide.html
">Show / hide columns dynamically</a></li><li><a href="../api/api_in_init.html
">Using API in callbacks</a></li><li><a href="../api/tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="../api/regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="../ajax/index.html
">Ajax</a></h3><ul class="toc"><li><a href="../ajax/simple.html
">Ajax data source (arrays)</a></li><li><a href="../ajax/objects.html
">Ajax data source (objects)</a></li><li><a href="../ajax/deep.html
">Nested object data (objects)</a></li><li><a href="../ajax/objects_subarrays.html
">Nested object data (arrays)</a></li><li><a href="../ajax/orthogonal-data.html
">Orthogonal data</a></li><li><a href="../ajax/null_data_source.html
">Generated content for a column</a></li><li><a href="../ajax/custom_data_property.html
">Custom data source property</a></li><li><a href="../ajax/custom_data_flat.html
">Flat array data source</a></li><li><a href="../ajax/defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="./index.html
">Server-side</a></h3><ul class="toc active"><li><a href="./simple.html
">Server-side processing</a></li><li><a href="./custom_vars.html
">Custom HTTP variables</a></li><li><a href="./post.html
">POST data</a></li><li class="active"><a href="./ids.html
">Automatic addition of row ID attributes</a></li><li><a href="./object_data.html
">Object data source</a></li><li><a href="./row_details.html
">Row details</a></li><li><a href="./select_rows.html
">Row selection</a></li><li><a href="./jsonp.html
">JSONP data source for remote domains</a></li><li><a href="./defer_loading.html
">Deferred loading of data</a></li><li><a href="./pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="../plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="../plug-ins/api.html
">API plug-in methods</a></li><li><a href="../plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="../plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="../plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="../plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div> </div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="../basic_init/index.html">Basic initialisation</a></h3>
<ul class="toc">
<li>
<a href="../basic_init/zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="../basic_init/filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="../basic_init/table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="../basic_init/multi_col_sort.html">Multi-column ordering</a>
</li>
<li>
<a href="../basic_init/multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="../basic_init/hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="../basic_init/complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="../basic_init/dom.html">DOM positioning</a>
</li>
<li>
<a href="../basic_init/flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="../basic_init/state_save.html">State saving</a>
</li>
<li>
<a href="../basic_init/alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="../basic_init/scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="../basic_init/scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="../basic_init/scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="../basic_init/scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="../basic_init/comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="../basic_init/language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../advanced_init/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="../advanced_init/events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="../advanced_init/dt_events.html">DataTables events</a>
</li>
<li>
<a href="../advanced_init/column_render.html">Column rendering</a>
</li>
<li>
<a href="../advanced_init/length_menu.html">Page length options</a>
</li>
<li>
<a href="../advanced_init/dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="../advanced_init/complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="../advanced_init/object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="../advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="../advanced_init/language_file.html">Language file</a>
</li>
<li>
<a href="../advanced_init/defaults.html">Setting defaults</a>
</li>
<li>
<a href="../advanced_init/row_callback.html">Row created callback</a>
</li>
<li>
<a href="../advanced_init/row_grouping.html">Row grouping</a>
</li>
<li>
<a href="../advanced_init/footer_callback.html">Footer callback</a>
</li>
<li>
<a href="../advanced_init/dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="../advanced_init/sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/display.html">Base style</a>
</li>
<li>
<a href="../styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="../styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="../styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="../styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="../styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="../styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="../styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="../styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="../styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../data_sources/index.html">Data sources</a></h3>
<ul class="toc">
<li>
<a href="../data_sources/dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="../data_sources/ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="../data_sources/js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="../data_sources/server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="../api/add_row.html">Add rows</a>
</li>
<li>
<a href="../api/multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="../api/multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="../api/highlight.html">Highlighting rows and columns</a>
</li>
<li>
<a href="../api/row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="../api/select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="../api/select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="../api/form.html">Form inputs</a>
</li>
<li>
<a href="../api/counter_columns.html">Index column</a>
</li>
<li>
<a href="../api/show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="../api/api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="../api/tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="../api/regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../ajax/index.html">Ajax</a></h3>
<ul class="toc">
<li>
<a href="../ajax/simple.html">Ajax data source (arrays)</a>
</li>
<li>
<a href="../ajax/objects.html">Ajax data source (objects)</a>
</li>
<li>
<a href="../ajax/deep.html">Nested object data (objects)</a>
</li>
<li>
<a href="../ajax/objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="../ajax/orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="../ajax/null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="../ajax/custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="../ajax/custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="../ajax/defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./index.html">Server-side</a></h3>
<ul class="toc active">
<li>
<a href="./simple.html">Server-side processing</a>
</li>
<li>
<a href="./custom_vars.html">Custom HTTP variables</a>
</li>
<li>
<a href="./post.html">POST data</a>
</li>
<li class="active">
<a href="./ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="./object_data.html">Object data source</a>
</li>
<li>
<a href="./row_details.html">Row details</a>
</li>
<li>
<a href="./select_rows.html">Row selection</a>
</li>
<li>
<a href="./jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="./defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="./pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="../plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="../plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

View File

@ -1,85 +1,61 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <title>DataTables examples - Server-side processing</title>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"> </head>
</script> <body class="dt-example">
<script type="text/javascript" language="javascript" src="../resources/demo.js"> <div class="container">
</script> <section>
<title>DataTables examples - Server-side processing</title> <h1>DataTables example <span>Server-side processing</span></h1>
</head> <div class="info">
<body class="dt-example"> <p>There are many ways to get your data into DataTables, and if you are working with seriously large databases, you might want to consider using the server-side options that DataTables provides. With server-side processing enabled, all paging, searching, ordering etc actions that DataTables performs are handed off to a server where an SQL engine (or similar) can perform these actions on the large data set (after all, that's what the database engine is designed for!). As such, each draw of the table will result in a new Ajax request being made to get the required data.</p>
<div class="container">
<p>Server-side processing is enabled by setting the <a href="//datatables.net/reference/option/serverSide"><code class="option" title="DataTables initialisation option">serverSide</code></a> option to <code>true</code> and providing an Ajax data source through the <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> option.</p>
<p>The examples in this section shows server-side processing in use and how it can be customised to suit your needs.</p>
</div>
</section>
</div>
<section> <section>
<h1>DataTables example <span>Server-side processing</span></h1> <div class="footer">
<div class="info"> <div class="gradient"></div>
<p>There are many ways to get your data into DataTables, and if you are working with seriously large databases, you might want to consider using the server-side <div class="liner">
options that DataTables provides. With server-side processing enabled, all paging, searching, ordering etc actions that DataTables performs are handed off to a <div class="toc">
server where an SQL engine (or similar) can perform these actions on the large data set (after all, that's what the database engine is designed for!). As such, <div class="toc-group"><h3><a href="./index.html
each draw of the table will result in a new Ajax request being made to get the required data.</p> ">Server-side</a></h3><ul class="toc"><li><a href="./simple.html
<p>Server-side processing is enabled by setting the <a href="//datatables.net/reference/option/serverSide"><code class="option" title= ">Server-side processing</a></li><li><a href="./custom_vars.html
"DataTables initialisation option">serverSide</code></a> option to <code>true</code> and providing an Ajax data source through the <a href= ">Custom HTTP variables</a></li><li><a href="./post.html
"//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> option.</p> ">POST data</a></li><li><a href="./ids.html
<p>The examples in this section shows server-side processing in use and how it can be customised to suit your needs.</p> ">Automatic addition of row ID attributes</a></li><li><a href="./object_data.html
</div> ">Object data source</a></li><li><a href="./row_details.html
</section> ">Row details</a></li><li><a href="./select_rows.html
</div> ">Row selection</a></li><li><a href="./jsonp.html
<section> ">JSONP data source for remote domains</a></li><li><a href="./defer_loading.html
<div class="footer"> ">Deferred loading of data</a></li><li><a href="./pipeline.html
<div class="gradient"></div> ">Pipelining data to reduce Ajax calls for paging</a></li></ul></div>
<div class="liner"> </div>
<div class="toc">
<div class="toc-group"> <div class="epilogue">
<h3><a href="./index.html">Server-side</a></h3> <p>
<ul class="toc"> Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
<li> Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
<a href="./simple.html">Server-side processing</a> </p>
</li>
<li> <p class="copyright">
<a href="./custom_vars.html">Custom HTTP variables</a> DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
</li> DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
<li> </p>
<a href="./post.html">POST data</a>
</li>
<li>
<a href="./ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="./object_data.html">Object data source</a>
</li>
<li>
<a href="./row_details.html">Row details</a>
</li>
<li>
<a href="./select_rows.html">Row selection</a>
</li>
<li>
<a href="./jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="./defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="./pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div> </div>
</div> </div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div> </div>
</div> </section>
</section> </body>
</body>
</html> </html>

View File

@ -1,26 +1,19 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<title>DataTables example - JSONP data source for remote domains</title>
<link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"> <title>DataTables example - JSONP data source for remote domains</title>
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"><link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<style type="text/css" class="init"> <style type="text/css" class="init">
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <script type="text/javascript" language="javascript" class="init">
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() { $(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
"processing": true, "processing": true,
@ -32,56 +25,36 @@ $(document).ready(function() {
} ); } );
} ); } );
</script> </script>
</head> </head>
<body class="dt-example"> <body class="dt-example ">
<div class="container"> <div class="container">
<section> <section>
<h1>DataTables example <span>JSONP data source for remote domains</span></h1> <h1>DataTables example <span>JSONP data source for remote domains</span></h1>
<div class="info"> <div class="info">
<p><a href="http://bob.pythonmac.org/archives/2005/12/05/remote-json-jsonp/">JSONP</a> is one of several methods to allow the use of JSON data from any server <p><a href="http://bob.pythonmac.org/archives/2005/12/05/remote-json-jsonp/">JSONP</a> is one of several methods to allow the use of JSON data from any server (browsers have XSS protection rules which will block standard Ajax requests to remote source for security reasons). Using JSONP allows DataTables to load server-side sourced data from any domain and is quite simply done with the <code>dataType</code> option of the <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> initialisation option.</p>
(browsers have XSS protection rules which will block standard Ajax requests to remote source for security reasons). Using JSONP allows DataTables to load
server-side sourced data from any domain and is quite simply done with the <code>dataType</code> option of the <a href= <p>When given as an object, the <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> option maps directly onto the <a href="http://api.jquery.com/jQuery.ajax/">jQuery ajax</a> options (i.e. any option that can be used in jQuery's Ajax function can also be used in DataTable's <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> option).</p>
"//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> initialisation option.</p>
<p>When given as an object, the <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> <p>The example below shows <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> being used with the <code>dataType</code> option set to retrieve JSONP data for server-side processing in DataTables.</p>
option maps directly onto the <a href="http://api.jquery.com/jQuery.ajax/">jQuery ajax</a> options (i.e. any option that can be used in jQuery's Ajax function can
also be used in DataTable's <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> </div>
option).</p>
<p>The example below shows <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> being
used with the <code>dataType</code> option set to retrieve JSONP data for server-side processing in DataTables.</p> <table id="example" class="display" cellspacing="0" width="100%"><thead><tr><th>First name</th><th>Last name</th><th>Position</th><th>Office</th><th>Start date</th><th>Salary</th></tr></thead><tfoot><tr><th>First name</th><th>Last name</th><th>Position</th><th>Office</th><th>Start date</th><th>Salary</th></tr></tfoot></table>
</div>
<table id="example" class="display" cellspacing="0" width="100%"> <ul class="tabs">
<thead> <li class="active">Javascript</li>
<tr> <li>HTML</li>
<th>First name</th> <li>CSS</li>
<th>Last name</th> <li>Ajax</li>
<th>Position</th> <li>Server-side script</li>
<th>Office</th> </ul>
<th>Start date</th>
<th>Salary</th> <div class="tabs">
</tr> <div class="js">
</thead> <p>The Javascript shown below is used to initialise the table shown in this example:</p>
<tfoot> <code class="multiline language-js">$(document).ready(function() {
<tr>
<th>First name</th>
<th>Last name</th>
<th>Position</th>
<th>Office</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
&quot;processing&quot;: true, &quot;processing&quot;: true,
&quot;serverSide&quot;: true, &quot;serverSide&quot;: true,
@ -91,366 +64,153 @@ $(document).ready(function() {
} }
} ); } );
} );</code> } );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul> <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<li> <ul><li><a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a></li><li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li></ul>
<a href="//code.jquery.com/jquery-1.12.3.js">//code.jquery.com/jquery-1.12.3.js</a> </div>
</li> <div class="table">
<li> <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
<a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a> </div>
</li> <div class="css">
</ul> <div>
</div> <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 additional CSS used is shown below:</p>
<div class="table"> <code class="multiline language-css"></code>
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p> </div>
</div>
<div class="css"> <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<div> <ul><li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li></ul>
<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 </div>
additional CSS used is shown below:</p><code class="multiline language-css"></code> <div class="ajax">
<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 loaded.</p>
</div>
<div class="php">
<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 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables documentation</a>.</p>
</div> </div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a>
</li>
</ul>
</div> </div>
<div class="ajax"> </section>
<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
loaded.</p>
</div> </div>
<div class="php">
<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 <section>
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables <div class="footer">
documentation</a>.</p> <div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group"><h3><a href="../basic_init/index.html
">Basic initialisation</a></h3><ul class="toc"><li><a href="../basic_init/zero_configuration.html
">Zero configuration</a></li><li><a href="../basic_init/filter_only.html
">Feature enable / disable</a></li><li><a href="../basic_init/table_sorting.html
">Default ordering (sorting)</a></li><li><a href="../basic_init/multi_col_sort.html
">Multi-column ordering</a></li><li><a href="../basic_init/multiple_tables.html
">Multiple tables</a></li><li><a href="../basic_init/hidden_columns.html
">Hidden columns</a></li><li><a href="../basic_init/complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="../basic_init/dom.html
">DOM positioning</a></li><li><a href="../basic_init/flexible_width.html
">Flexible table width</a></li><li><a href="../basic_init/state_save.html
">State saving</a></li><li><a href="../basic_init/alt_pagination.html
">Alternative pagination</a></li><li><a href="../basic_init/scroll_y.html
">Scroll - vertical</a></li><li><a href="../basic_init/scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="../basic_init/scroll_x.html
">Scroll - horizontal</a></li><li><a href="../basic_init/scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="../basic_init/comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="../basic_init/language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="../advanced_init/index.html
">Advanced initialisation</a></h3><ul class="toc"><li><a href="../advanced_init/events_live.html
">DOM / jQuery events</a></li><li><a href="../advanced_init/dt_events.html
">DataTables events</a></li><li><a href="../advanced_init/column_render.html
">Column rendering</a></li><li><a href="../advanced_init/length_menu.html
">Page length options</a></li><li><a href="../advanced_init/dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="../advanced_init/complex_header.html
">Complex headers with column visibility</a></li><li><a href="../advanced_init/object_dom_read.html
">Read HTML to data objects</a></li><li><a href="../advanced_init/html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="../advanced_init/html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="../advanced_init/language_file.html
">Language file</a></li><li><a href="../advanced_init/defaults.html
">Setting defaults</a></li><li><a href="../advanced_init/row_callback.html
">Row created callback</a></li><li><a href="../advanced_init/row_grouping.html
">Row grouping</a></li><li><a href="../advanced_init/footer_callback.html
">Footer callback</a></li><li><a href="../advanced_init/dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="../advanced_init/sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="../styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="../styling/display.html
">Base style</a></li><li><a href="../styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="../styling/cell-border.html
">Base style - cell borders</a></li><li><a href="../styling/compact.html
">Base style - compact</a></li><li><a href="../styling/hover.html
">Base style - hover</a></li><li><a href="../styling/order-column.html
">Base style - order-column</a></li><li><a href="../styling/row-border.html
">Base style - row borders</a></li><li><a href="../styling/stripe.html
">Base style - stripe</a></li><li><a href="../styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="../styling/foundation.html
">Foundation</a></li><li><a href="../styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="../styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="../styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="../styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="../styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="../data_sources/index.html
">Data sources</a></h3><ul class="toc"><li><a href="../data_sources/dom.html
">HTML (DOM) sourced data</a></li><li><a href="../data_sources/ajax.html
">Ajax sourced data</a></li><li><a href="../data_sources/js_array.html
">Javascript sourced data</a></li><li><a href="../data_sources/server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="../api/index.html
">API</a></h3><ul class="toc"><li><a href="../api/add_row.html
">Add rows</a></li><li><a href="../api/multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="../api/multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="../api/highlight.html
">Highlighting rows and columns</a></li><li><a href="../api/row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="../api/select_row.html
">Row selection (multiple rows)</a></li><li><a href="../api/select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="../api/form.html
">Form inputs</a></li><li><a href="../api/counter_columns.html
">Index column</a></li><li><a href="../api/show_hide.html
">Show / hide columns dynamically</a></li><li><a href="../api/api_in_init.html
">Using API in callbacks</a></li><li><a href="../api/tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="../api/regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="../ajax/index.html
">Ajax</a></h3><ul class="toc"><li><a href="../ajax/simple.html
">Ajax data source (arrays)</a></li><li><a href="../ajax/objects.html
">Ajax data source (objects)</a></li><li><a href="../ajax/deep.html
">Nested object data (objects)</a></li><li><a href="../ajax/objects_subarrays.html
">Nested object data (arrays)</a></li><li><a href="../ajax/orthogonal-data.html
">Orthogonal data</a></li><li><a href="../ajax/null_data_source.html
">Generated content for a column</a></li><li><a href="../ajax/custom_data_property.html
">Custom data source property</a></li><li><a href="../ajax/custom_data_flat.html
">Flat array data source</a></li><li><a href="../ajax/defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="./index.html
">Server-side</a></h3><ul class="toc active"><li><a href="./simple.html
">Server-side processing</a></li><li><a href="./custom_vars.html
">Custom HTTP variables</a></li><li><a href="./post.html
">POST data</a></li><li><a href="./ids.html
">Automatic addition of row ID attributes</a></li><li><a href="./object_data.html
">Object data source</a></li><li><a href="./row_details.html
">Row details</a></li><li><a href="./select_rows.html
">Row selection</a></li><li class="active"><a href="./jsonp.html
">JSONP data source for remote domains</a></li><li><a href="./defer_loading.html
">Deferred loading of data</a></li><li><a href="./pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="../plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="../plug-ins/api.html
">API plug-in methods</a></li><li><a href="../plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="../plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="../plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="../plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div> </div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="../basic_init/index.html">Basic initialisation</a></h3>
<ul class="toc">
<li>
<a href="../basic_init/zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="../basic_init/filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="../basic_init/table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="../basic_init/multi_col_sort.html">Multi-column ordering</a>
</li>
<li>
<a href="../basic_init/multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="../basic_init/hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="../basic_init/complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="../basic_init/dom.html">DOM positioning</a>
</li>
<li>
<a href="../basic_init/flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="../basic_init/state_save.html">State saving</a>
</li>
<li>
<a href="../basic_init/alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="../basic_init/scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="../basic_init/scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="../basic_init/scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="../basic_init/scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="../basic_init/comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="../basic_init/language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../advanced_init/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="../advanced_init/events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="../advanced_init/dt_events.html">DataTables events</a>
</li>
<li>
<a href="../advanced_init/column_render.html">Column rendering</a>
</li>
<li>
<a href="../advanced_init/length_menu.html">Page length options</a>
</li>
<li>
<a href="../advanced_init/dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="../advanced_init/complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="../advanced_init/object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="../advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="../advanced_init/language_file.html">Language file</a>
</li>
<li>
<a href="../advanced_init/defaults.html">Setting defaults</a>
</li>
<li>
<a href="../advanced_init/row_callback.html">Row created callback</a>
</li>
<li>
<a href="../advanced_init/row_grouping.html">Row grouping</a>
</li>
<li>
<a href="../advanced_init/footer_callback.html">Footer callback</a>
</li>
<li>
<a href="../advanced_init/dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="../advanced_init/sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/display.html">Base style</a>
</li>
<li>
<a href="../styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="../styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="../styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="../styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="../styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="../styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="../styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="../styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="../styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../data_sources/index.html">Data sources</a></h3>
<ul class="toc">
<li>
<a href="../data_sources/dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="../data_sources/ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="../data_sources/js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="../data_sources/server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="../api/add_row.html">Add rows</a>
</li>
<li>
<a href="../api/multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="../api/multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="../api/highlight.html">Highlighting rows and columns</a>
</li>
<li>
<a href="../api/row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="../api/select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="../api/select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="../api/form.html">Form inputs</a>
</li>
<li>
<a href="../api/counter_columns.html">Index column</a>
</li>
<li>
<a href="../api/show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="../api/api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="../api/tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="../api/regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../ajax/index.html">Ajax</a></h3>
<ul class="toc">
<li>
<a href="../ajax/simple.html">Ajax data source (arrays)</a>
</li>
<li>
<a href="../ajax/objects.html">Ajax data source (objects)</a>
</li>
<li>
<a href="../ajax/deep.html">Nested object data (objects)</a>
</li>
<li>
<a href="../ajax/objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="../ajax/orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="../ajax/null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="../ajax/custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="../ajax/custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="../ajax/defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./index.html">Server-side</a></h3>
<ul class="toc active">
<li>
<a href="./simple.html">Server-side processing</a>
</li>
<li>
<a href="./custom_vars.html">Custom HTTP variables</a>
</li>
<li>
<a href="./post.html">POST data</a>
</li>
<li>
<a href="./ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="./object_data.html">Object data source</a>
</li>
<li>
<a href="./row_details.html">Row details</a>
</li>
<li>
<a href="./select_rows.html">Row selection</a>
</li>
<li class="active">
<a href="./jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="./defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="./pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="../plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="../plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

View File

@ -1,26 +1,19 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<title>DataTables example - Object data source</title>
<link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"> <title>DataTables example - Object data source</title>
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"><link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<style type="text/css" class="init"> <style type="text/css" class="init">
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <script type="text/javascript" language="javascript" class="init">
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() { $(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
"processing": true, "processing": true,
@ -37,52 +30,34 @@ $(document).ready(function() {
} ); } );
} ); } );
</script> </script>
</head> </head>
<body class="dt-example"> <body class="dt-example ">
<div class="container"> <div class="container">
<section> <section>
<h1>DataTables example <span>Object data source</span></h1> <h1>DataTables example <span>Object data source</span></h1>
<div class="info"> <div class="info">
<p>The default data format that DataTables expects for server-side processing is a 2D array of data (rows by columns). However, this is often not flexible enough <p>The default data format that DataTables expects for server-side processing is a 2D array of data (rows by columns). However, this is often not flexible enough for either the server-side environment, or you might want to convey more information in the data source than is necessary to show in the table (row IDs from the database for example). For these situations DataTables supports the reading of data for objects as well as arrays.</p>
for either the server-side environment, or you might want to convey more information in the data source than is necessary to show in the table (row IDs from the
database for example). For these situations DataTables supports the reading of data for objects as well as arrays.</p> <p>In this example the server responds with an array of objects, where DataTables will look up and use each property that is specified by the <a href="//datatables.net/reference/option/columns.data"><code class="option" title="DataTables initialisation option">columns.data</code></a> property given for each column.</p>
<p>In this example the server responds with an array of objects, where DataTables will look up and use each property that is specified by the <a href=
"//datatables.net/reference/option/columns.data"><code class="option" title="DataTables initialisation option">columns.data</code></a> property given for each </div>
column.</p>
</div>
<table id="example" class="display" cellspacing="0" width="100%"> <table id="example" class="display" cellspacing="0" width="100%"><thead><tr><th>First name</th><th>Last name</th><th>Position</th><th>Office</th><th>Start date</th><th>Salary</th></tr></thead><tfoot><tr><th>First name</th><th>Last name</th><th>Position</th><th>Office</th><th>Start date</th><th>Salary</th></tr></tfoot></table>
<thead>
<tr> <ul class="tabs">
<th>First name</th> <li class="active">Javascript</li>
<th>Last name</th> <li>HTML</li>
<th>Position</th> <li>CSS</li>
<th>Office</th> <li>Ajax</li>
<th>Start date</th> <li>Server-side script</li>
<th>Salary</th> </ul>
</tr>
</thead> <div class="tabs">
<tfoot> <div class="js">
<tr> <p>The Javascript shown below is used to initialise the table shown in this example:</p>
<th>First name</th> <code class="multiline language-js">$(document).ready(function() {
<th>Last name</th>
<th>Position</th>
<th>Office</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
&quot;processing&quot;: true, &quot;processing&quot;: true,
&quot;serverSide&quot;: true, &quot;serverSide&quot;: true,
@ -97,366 +72,153 @@ $(document).ready(function() {
] ]
} ); } );
} );</code> } );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul> <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<li> <ul><li><a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a></li><li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li></ul>
<a href="//code.jquery.com/jquery-1.12.3.js">//code.jquery.com/jquery-1.12.3.js</a> </div>
</li> <div class="table">
<li> <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
<a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a> </div>
</li> <div class="css">
</ul> <div>
</div> <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 additional CSS used is shown below:</p>
<div class="table"> <code class="multiline language-css"></code>
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p> </div>
</div>
<div class="css"> <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<div> <ul><li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li></ul>
<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 </div>
additional CSS used is shown below:</p><code class="multiline language-css"></code> <div class="ajax">
<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 loaded.</p>
</div>
<div class="php">
<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 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables documentation</a>.</p>
</div> </div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a>
</li>
</ul>
</div> </div>
<div class="ajax"> </section>
<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
loaded.</p>
</div> </div>
<div class="php">
<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 <section>
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables <div class="footer">
documentation</a>.</p> <div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group"><h3><a href="../basic_init/index.html
">Basic initialisation</a></h3><ul class="toc"><li><a href="../basic_init/zero_configuration.html
">Zero configuration</a></li><li><a href="../basic_init/filter_only.html
">Feature enable / disable</a></li><li><a href="../basic_init/table_sorting.html
">Default ordering (sorting)</a></li><li><a href="../basic_init/multi_col_sort.html
">Multi-column ordering</a></li><li><a href="../basic_init/multiple_tables.html
">Multiple tables</a></li><li><a href="../basic_init/hidden_columns.html
">Hidden columns</a></li><li><a href="../basic_init/complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="../basic_init/dom.html
">DOM positioning</a></li><li><a href="../basic_init/flexible_width.html
">Flexible table width</a></li><li><a href="../basic_init/state_save.html
">State saving</a></li><li><a href="../basic_init/alt_pagination.html
">Alternative pagination</a></li><li><a href="../basic_init/scroll_y.html
">Scroll - vertical</a></li><li><a href="../basic_init/scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="../basic_init/scroll_x.html
">Scroll - horizontal</a></li><li><a href="../basic_init/scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="../basic_init/comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="../basic_init/language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="../advanced_init/index.html
">Advanced initialisation</a></h3><ul class="toc"><li><a href="../advanced_init/events_live.html
">DOM / jQuery events</a></li><li><a href="../advanced_init/dt_events.html
">DataTables events</a></li><li><a href="../advanced_init/column_render.html
">Column rendering</a></li><li><a href="../advanced_init/length_menu.html
">Page length options</a></li><li><a href="../advanced_init/dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="../advanced_init/complex_header.html
">Complex headers with column visibility</a></li><li><a href="../advanced_init/object_dom_read.html
">Read HTML to data objects</a></li><li><a href="../advanced_init/html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="../advanced_init/html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="../advanced_init/language_file.html
">Language file</a></li><li><a href="../advanced_init/defaults.html
">Setting defaults</a></li><li><a href="../advanced_init/row_callback.html
">Row created callback</a></li><li><a href="../advanced_init/row_grouping.html
">Row grouping</a></li><li><a href="../advanced_init/footer_callback.html
">Footer callback</a></li><li><a href="../advanced_init/dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="../advanced_init/sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="../styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="../styling/display.html
">Base style</a></li><li><a href="../styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="../styling/cell-border.html
">Base style - cell borders</a></li><li><a href="../styling/compact.html
">Base style - compact</a></li><li><a href="../styling/hover.html
">Base style - hover</a></li><li><a href="../styling/order-column.html
">Base style - order-column</a></li><li><a href="../styling/row-border.html
">Base style - row borders</a></li><li><a href="../styling/stripe.html
">Base style - stripe</a></li><li><a href="../styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="../styling/foundation.html
">Foundation</a></li><li><a href="../styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="../styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="../styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="../styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="../styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="../data_sources/index.html
">Data sources</a></h3><ul class="toc"><li><a href="../data_sources/dom.html
">HTML (DOM) sourced data</a></li><li><a href="../data_sources/ajax.html
">Ajax sourced data</a></li><li><a href="../data_sources/js_array.html
">Javascript sourced data</a></li><li><a href="../data_sources/server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="../api/index.html
">API</a></h3><ul class="toc"><li><a href="../api/add_row.html
">Add rows</a></li><li><a href="../api/multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="../api/multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="../api/highlight.html
">Highlighting rows and columns</a></li><li><a href="../api/row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="../api/select_row.html
">Row selection (multiple rows)</a></li><li><a href="../api/select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="../api/form.html
">Form inputs</a></li><li><a href="../api/counter_columns.html
">Index column</a></li><li><a href="../api/show_hide.html
">Show / hide columns dynamically</a></li><li><a href="../api/api_in_init.html
">Using API in callbacks</a></li><li><a href="../api/tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="../api/regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="../ajax/index.html
">Ajax</a></h3><ul class="toc"><li><a href="../ajax/simple.html
">Ajax data source (arrays)</a></li><li><a href="../ajax/objects.html
">Ajax data source (objects)</a></li><li><a href="../ajax/deep.html
">Nested object data (objects)</a></li><li><a href="../ajax/objects_subarrays.html
">Nested object data (arrays)</a></li><li><a href="../ajax/orthogonal-data.html
">Orthogonal data</a></li><li><a href="../ajax/null_data_source.html
">Generated content for a column</a></li><li><a href="../ajax/custom_data_property.html
">Custom data source property</a></li><li><a href="../ajax/custom_data_flat.html
">Flat array data source</a></li><li><a href="../ajax/defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="./index.html
">Server-side</a></h3><ul class="toc active"><li><a href="./simple.html
">Server-side processing</a></li><li><a href="./custom_vars.html
">Custom HTTP variables</a></li><li><a href="./post.html
">POST data</a></li><li><a href="./ids.html
">Automatic addition of row ID attributes</a></li><li class="active"><a href="./object_data.html
">Object data source</a></li><li><a href="./row_details.html
">Row details</a></li><li><a href="./select_rows.html
">Row selection</a></li><li><a href="./jsonp.html
">JSONP data source for remote domains</a></li><li><a href="./defer_loading.html
">Deferred loading of data</a></li><li><a href="./pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="../plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="../plug-ins/api.html
">API plug-in methods</a></li><li><a href="../plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="../plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="../plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="../plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div> </div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="../basic_init/index.html">Basic initialisation</a></h3>
<ul class="toc">
<li>
<a href="../basic_init/zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="../basic_init/filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="../basic_init/table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="../basic_init/multi_col_sort.html">Multi-column ordering</a>
</li>
<li>
<a href="../basic_init/multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="../basic_init/hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="../basic_init/complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="../basic_init/dom.html">DOM positioning</a>
</li>
<li>
<a href="../basic_init/flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="../basic_init/state_save.html">State saving</a>
</li>
<li>
<a href="../basic_init/alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="../basic_init/scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="../basic_init/scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="../basic_init/scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="../basic_init/scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="../basic_init/comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="../basic_init/language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../advanced_init/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="../advanced_init/events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="../advanced_init/dt_events.html">DataTables events</a>
</li>
<li>
<a href="../advanced_init/column_render.html">Column rendering</a>
</li>
<li>
<a href="../advanced_init/length_menu.html">Page length options</a>
</li>
<li>
<a href="../advanced_init/dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="../advanced_init/complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="../advanced_init/object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="../advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="../advanced_init/language_file.html">Language file</a>
</li>
<li>
<a href="../advanced_init/defaults.html">Setting defaults</a>
</li>
<li>
<a href="../advanced_init/row_callback.html">Row created callback</a>
</li>
<li>
<a href="../advanced_init/row_grouping.html">Row grouping</a>
</li>
<li>
<a href="../advanced_init/footer_callback.html">Footer callback</a>
</li>
<li>
<a href="../advanced_init/dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="../advanced_init/sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/display.html">Base style</a>
</li>
<li>
<a href="../styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="../styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="../styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="../styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="../styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="../styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="../styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="../styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="../styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../data_sources/index.html">Data sources</a></h3>
<ul class="toc">
<li>
<a href="../data_sources/dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="../data_sources/ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="../data_sources/js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="../data_sources/server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="../api/add_row.html">Add rows</a>
</li>
<li>
<a href="../api/multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="../api/multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="../api/highlight.html">Highlighting rows and columns</a>
</li>
<li>
<a href="../api/row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="../api/select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="../api/select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="../api/form.html">Form inputs</a>
</li>
<li>
<a href="../api/counter_columns.html">Index column</a>
</li>
<li>
<a href="../api/show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="../api/api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="../api/tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="../api/regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../ajax/index.html">Ajax</a></h3>
<ul class="toc">
<li>
<a href="../ajax/simple.html">Ajax data source (arrays)</a>
</li>
<li>
<a href="../ajax/objects.html">Ajax data source (objects)</a>
</li>
<li>
<a href="../ajax/deep.html">Nested object data (objects)</a>
</li>
<li>
<a href="../ajax/objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="../ajax/orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="../ajax/null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="../ajax/custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="../ajax/custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="../ajax/defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./index.html">Server-side</a></h3>
<ul class="toc active">
<li>
<a href="./simple.html">Server-side processing</a>
</li>
<li>
<a href="./custom_vars.html">Custom HTTP variables</a>
</li>
<li>
<a href="./post.html">POST data</a>
</li>
<li>
<a href="./ids.html">Automatic addition of row ID attributes</a>
</li>
<li class="active">
<a href="./object_data.html">Object data source</a>
</li>
<li>
<a href="./row_details.html">Row details</a>
</li>
<li>
<a href="./select_rows.html">Row selection</a>
</li>
<li>
<a href="./jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="./defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="./pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="../plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="../plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

View File

@ -1,26 +1,19 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<title>DataTables example - Pipelining data to reduce Ajax calls for paging</title>
<link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"> <title>DataTables example - Pipelining data to reduce Ajax calls for paging</title>
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"><link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<style type="text/css" class="init"> <style type="text/css" class="init">
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <script type="text/javascript" language="javascript" class="init">
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
// //
// Pipelining function for DataTables. To be used to the `ajax` option of DataTables // Pipelining function for DataTables. To be used to the `ajax` option of DataTables
@ -111,9 +104,7 @@ $.fn.dataTable.pipeline = function ( opts ) {
if ( cacheLower != drawStart ) { if ( cacheLower != drawStart ) {
json.data.splice( 0, drawStart-cacheLower ); json.data.splice( 0, drawStart-cacheLower );
} }
if ( requestLength >= -1 ) { json.data.splice( requestLength, json.data.length );
json.data.splice( requestLength, json.data.length );
}
drawCallback( json ); drawCallback( json );
} }
@ -154,55 +145,36 @@ $(document).ready(function() {
} ); } );
</script> </script>
</head> </head>
<body class="dt-example"> <body class="dt-example ">
<div class="container"> <div class="container">
<section> <section>
<h1>DataTables example <span>Pipelining data to reduce Ajax calls for paging</span></h1> <h1>DataTables example <span>Pipelining data to reduce Ajax calls for paging</span></h1>
<div class="info"> <div class="info">
<p>Server-side processing can be quite hard on your server, since it makes an Ajax call to the server for every draw request that is made. On sites with a large <p>Server-side processing can be quite hard on your server, since it makes an Ajax call to the server for every draw request that is made. On sites with a large number of page views, you could potentially end up DDoSing your own server with your own applications!</p>
number of page views, you could potentially end up DDoSing your own server with your own applications!</p>
<p>This example shows one technique to reduce the number of Ajax calls that are made to the server by caching more data than is needed for each draw. This is done <p>This example shows one technique to reduce the number of Ajax calls that are made to the server by caching more data than is needed for each draw. This is done by intercepting the Ajax call and routing it through a data cache control; using the data from the cache if available, and making the Ajax request if not. This intercept of the Ajax request is performed by giving the <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> option as a function. This function then performs the logic of deciding if another Ajax call is needed, or if data from the cache can be used.</p>
by intercepting the Ajax call and routing it through a data cache control; using the data from the cache if available, and making the Ajax request if not. This
intercept of the Ajax request is performed by giving the <a href="//datatables.net/reference/option/ajax"><code class="option" title= <p>Keep in mind that this caching is for paging only; the pipeline must be cleared for other interactions such as ordering and searching since the full data set, when using server-side processing, is only available at the server.</p>
"DataTables initialisation option">ajax</code></a> option as a function. This function then performs the logic of deciding if another Ajax call is needed, or if
data from the cache can be used.</p> </div>
<p>Keep in mind that this caching is for paging only; the pipeline must be cleared for other interactions such as ordering and searching since the full data set,
when using server-side processing, is only available at the server.</p>
</div> <table id="example" class="display" cellspacing="0" width="100%"><thead><tr><th>First name</th><th>Last name</th><th>Position</th><th>Office</th><th>Start date</th><th>Salary</th></tr></thead><tfoot><tr><th>First name</th><th>Last name</th><th>Position</th><th>Office</th><th>Start date</th><th>Salary</th></tr></tfoot></table>
<table id="example" class="display" cellspacing="0" width="100%">
<thead> <ul class="tabs">
<tr> <li class="active">Javascript</li>
<th>First name</th> <li>HTML</li>
<th>Last name</th> <li>CSS</li>
<th>Position</th> <li>Ajax</li>
<th>Office</th> <li>Server-side script</li>
<th>Start date</th> </ul>
<th>Salary</th>
</tr> <div class="tabs">
</thead> <div class="js">
<tfoot> <p>The Javascript shown below is used to initialise the table shown in this example:</p>
<tr> <code class="multiline language-js">//
<th>First name</th>
<th>Last name</th>
<th>Position</th>
<th>Office</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">//
// Pipelining function for DataTables. To be used to the `ajax` option of DataTables // Pipelining function for DataTables. To be used to the `ajax` option of DataTables
// //
$.fn.dataTable.pipeline = function ( opts ) { $.fn.dataTable.pipeline = function ( opts ) {
@ -291,9 +263,7 @@ $.fn.dataTable.pipeline = function ( opts ) {
if ( cacheLower != drawStart ) { if ( cacheLower != drawStart ) {
json.data.splice( 0, drawStart-cacheLower ); json.data.splice( 0, drawStart-cacheLower );
} }
if ( requestLength &gt;= -1 ) { json.data.splice( requestLength, json.data.length );
json.data.splice( requestLength, json.data.length );
}
drawCallback( json ); drawCallback( json );
} }
@ -332,366 +302,153 @@ $(document).ready(function() {
} ) } )
} ); } );
} );</code> } );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul> <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<li> <ul><li><a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a></li><li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li></ul>
<a href="//code.jquery.com/jquery-1.12.3.js">//code.jquery.com/jquery-1.12.3.js</a> </div>
</li> <div class="table">
<li> <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
<a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a> </div>
</li> <div class="css">
</ul> <div>
</div> <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 additional CSS used is shown below:</p>
<div class="table"> <code class="multiline language-css"></code>
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p> </div>
</div>
<div class="css"> <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<div> <ul><li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li></ul>
<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 </div>
additional CSS used is shown below:</p><code class="multiline language-css"></code> <div class="ajax">
<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 loaded.</p>
</div>
<div class="php">
<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 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables documentation</a>.</p>
</div> </div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a>
</li>
</ul>
</div> </div>
<div class="ajax"> </section>
<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
loaded.</p>
</div> </div>
<div class="php">
<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 <section>
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables <div class="footer">
documentation</a>.</p> <div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group"><h3><a href="../basic_init/index.html
">Basic initialisation</a></h3><ul class="toc"><li><a href="../basic_init/zero_configuration.html
">Zero configuration</a></li><li><a href="../basic_init/filter_only.html
">Feature enable / disable</a></li><li><a href="../basic_init/table_sorting.html
">Default ordering (sorting)</a></li><li><a href="../basic_init/multi_col_sort.html
">Multi-column ordering</a></li><li><a href="../basic_init/multiple_tables.html
">Multiple tables</a></li><li><a href="../basic_init/hidden_columns.html
">Hidden columns</a></li><li><a href="../basic_init/complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="../basic_init/dom.html
">DOM positioning</a></li><li><a href="../basic_init/flexible_width.html
">Flexible table width</a></li><li><a href="../basic_init/state_save.html
">State saving</a></li><li><a href="../basic_init/alt_pagination.html
">Alternative pagination</a></li><li><a href="../basic_init/scroll_y.html
">Scroll - vertical</a></li><li><a href="../basic_init/scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="../basic_init/scroll_x.html
">Scroll - horizontal</a></li><li><a href="../basic_init/scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="../basic_init/comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="../basic_init/language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="../advanced_init/index.html
">Advanced initialisation</a></h3><ul class="toc"><li><a href="../advanced_init/events_live.html
">DOM / jQuery events</a></li><li><a href="../advanced_init/dt_events.html
">DataTables events</a></li><li><a href="../advanced_init/column_render.html
">Column rendering</a></li><li><a href="../advanced_init/length_menu.html
">Page length options</a></li><li><a href="../advanced_init/dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="../advanced_init/complex_header.html
">Complex headers with column visibility</a></li><li><a href="../advanced_init/object_dom_read.html
">Read HTML to data objects</a></li><li><a href="../advanced_init/html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="../advanced_init/html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="../advanced_init/language_file.html
">Language file</a></li><li><a href="../advanced_init/defaults.html
">Setting defaults</a></li><li><a href="../advanced_init/row_callback.html
">Row created callback</a></li><li><a href="../advanced_init/row_grouping.html
">Row grouping</a></li><li><a href="../advanced_init/footer_callback.html
">Footer callback</a></li><li><a href="../advanced_init/dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="../advanced_init/sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="../styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="../styling/display.html
">Base style</a></li><li><a href="../styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="../styling/cell-border.html
">Base style - cell borders</a></li><li><a href="../styling/compact.html
">Base style - compact</a></li><li><a href="../styling/hover.html
">Base style - hover</a></li><li><a href="../styling/order-column.html
">Base style - order-column</a></li><li><a href="../styling/row-border.html
">Base style - row borders</a></li><li><a href="../styling/stripe.html
">Base style - stripe</a></li><li><a href="../styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="../styling/foundation.html
">Foundation</a></li><li><a href="../styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="../styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="../styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="../styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="../styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="../data_sources/index.html
">Data sources</a></h3><ul class="toc"><li><a href="../data_sources/dom.html
">HTML (DOM) sourced data</a></li><li><a href="../data_sources/ajax.html
">Ajax sourced data</a></li><li><a href="../data_sources/js_array.html
">Javascript sourced data</a></li><li><a href="../data_sources/server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="../api/index.html
">API</a></h3><ul class="toc"><li><a href="../api/add_row.html
">Add rows</a></li><li><a href="../api/multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="../api/multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="../api/highlight.html
">Highlighting rows and columns</a></li><li><a href="../api/row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="../api/select_row.html
">Row selection (multiple rows)</a></li><li><a href="../api/select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="../api/form.html
">Form inputs</a></li><li><a href="../api/counter_columns.html
">Index column</a></li><li><a href="../api/show_hide.html
">Show / hide columns dynamically</a></li><li><a href="../api/api_in_init.html
">Using API in callbacks</a></li><li><a href="../api/tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="../api/regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="../ajax/index.html
">Ajax</a></h3><ul class="toc"><li><a href="../ajax/simple.html
">Ajax data source (arrays)</a></li><li><a href="../ajax/objects.html
">Ajax data source (objects)</a></li><li><a href="../ajax/deep.html
">Nested object data (objects)</a></li><li><a href="../ajax/objects_subarrays.html
">Nested object data (arrays)</a></li><li><a href="../ajax/orthogonal-data.html
">Orthogonal data</a></li><li><a href="../ajax/null_data_source.html
">Generated content for a column</a></li><li><a href="../ajax/custom_data_property.html
">Custom data source property</a></li><li><a href="../ajax/custom_data_flat.html
">Flat array data source</a></li><li><a href="../ajax/defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="./index.html
">Server-side</a></h3><ul class="toc active"><li><a href="./simple.html
">Server-side processing</a></li><li><a href="./custom_vars.html
">Custom HTTP variables</a></li><li><a href="./post.html
">POST data</a></li><li><a href="./ids.html
">Automatic addition of row ID attributes</a></li><li><a href="./object_data.html
">Object data source</a></li><li><a href="./row_details.html
">Row details</a></li><li><a href="./select_rows.html
">Row selection</a></li><li><a href="./jsonp.html
">JSONP data source for remote domains</a></li><li><a href="./defer_loading.html
">Deferred loading of data</a></li><li class="active"><a href="./pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="../plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="../plug-ins/api.html
">API plug-in methods</a></li><li><a href="../plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="../plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="../plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="../plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div> </div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="../basic_init/index.html">Basic initialisation</a></h3>
<ul class="toc">
<li>
<a href="../basic_init/zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="../basic_init/filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="../basic_init/table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="../basic_init/multi_col_sort.html">Multi-column ordering</a>
</li>
<li>
<a href="../basic_init/multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="../basic_init/hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="../basic_init/complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="../basic_init/dom.html">DOM positioning</a>
</li>
<li>
<a href="../basic_init/flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="../basic_init/state_save.html">State saving</a>
</li>
<li>
<a href="../basic_init/alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="../basic_init/scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="../basic_init/scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="../basic_init/scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="../basic_init/scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="../basic_init/comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="../basic_init/language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../advanced_init/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="../advanced_init/events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="../advanced_init/dt_events.html">DataTables events</a>
</li>
<li>
<a href="../advanced_init/column_render.html">Column rendering</a>
</li>
<li>
<a href="../advanced_init/length_menu.html">Page length options</a>
</li>
<li>
<a href="../advanced_init/dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="../advanced_init/complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="../advanced_init/object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="../advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="../advanced_init/language_file.html">Language file</a>
</li>
<li>
<a href="../advanced_init/defaults.html">Setting defaults</a>
</li>
<li>
<a href="../advanced_init/row_callback.html">Row created callback</a>
</li>
<li>
<a href="../advanced_init/row_grouping.html">Row grouping</a>
</li>
<li>
<a href="../advanced_init/footer_callback.html">Footer callback</a>
</li>
<li>
<a href="../advanced_init/dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="../advanced_init/sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/display.html">Base style</a>
</li>
<li>
<a href="../styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="../styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="../styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="../styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="../styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="../styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="../styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="../styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="../styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../data_sources/index.html">Data sources</a></h3>
<ul class="toc">
<li>
<a href="../data_sources/dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="../data_sources/ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="../data_sources/js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="../data_sources/server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="../api/add_row.html">Add rows</a>
</li>
<li>
<a href="../api/multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="../api/multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="../api/highlight.html">Highlighting rows and columns</a>
</li>
<li>
<a href="../api/row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="../api/select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="../api/select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="../api/form.html">Form inputs</a>
</li>
<li>
<a href="../api/counter_columns.html">Index column</a>
</li>
<li>
<a href="../api/show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="../api/api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="../api/tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="../api/regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../ajax/index.html">Ajax</a></h3>
<ul class="toc">
<li>
<a href="../ajax/simple.html">Ajax data source (arrays)</a>
</li>
<li>
<a href="../ajax/objects.html">Ajax data source (objects)</a>
</li>
<li>
<a href="../ajax/deep.html">Nested object data (objects)</a>
</li>
<li>
<a href="../ajax/objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="../ajax/orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="../ajax/null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="../ajax/custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="../ajax/custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="../ajax/defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./index.html">Server-side</a></h3>
<ul class="toc active">
<li>
<a href="./simple.html">Server-side processing</a>
</li>
<li>
<a href="./custom_vars.html">Custom HTTP variables</a>
</li>
<li>
<a href="./post.html">POST data</a>
</li>
<li>
<a href="./ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="./object_data.html">Object data source</a>
</li>
<li>
<a href="./row_details.html">Row details</a>
</li>
<li>
<a href="./select_rows.html">Row selection</a>
</li>
<li>
<a href="./jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="./defer_loading.html">Deferred loading of data</a>
</li>
<li class="active">
<a href="./pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="../plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="../plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

View File

@ -1,26 +1,19 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<title>DataTables example - POST data</title>
<link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"> <title>DataTables example - POST data</title>
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"><link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<style type="text/css" class="init"> <style type="text/css" class="init">
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <script type="text/javascript" language="javascript" class="init">
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() { $(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
@ -41,55 +34,36 @@ $(document).ready(function() {
} ); } );
} ); } );
</script> </script>
</head> </head>
<body class="dt-example"> <body class="dt-example ">
<div class="container"> <div class="container">
<section> <section>
<h1>DataTables example <span>POST data</span></h1> <h1>DataTables example <span>POST data</span></h1>
<div class="info"> <div class="info">
<p>By default, the Ajax request that DataTables makes to obtain server-side processing data is an HTTP GET request. However, there are times when you might wish to <p>By default, the Ajax request that DataTables makes to obtain server-side processing data is an HTTP GET request. However, there are times when you might wish to use POST. This is very easily done by using the <code>type</code> option of the <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> initialisation option.</p>
use POST. This is very easily done by using the <code>type</code> option of the <a href="//datatables.net/reference/option/ajax"><code class="option" title=
"DataTables initialisation option">ajax</code></a> initialisation option.</p> <p>When given as an object, the <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> option maps directly onto the <a href="http://api.jquery.com/jQuery.ajax/">jQuery ajax</a> options (i.e. any option that can be used in jQuery's Ajax function can also be used in DataTable's <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> option).</p>
<p>When given as an object, the <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a>
option maps directly onto the <a href="http://api.jquery.com/jQuery.ajax/">jQuery ajax</a> options (i.e. any option that can be used in jQuery's Ajax function can <p>The example below shows <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> being used with the <code>type</code> option set to <code class="string" title="String">POST</code> to make a POST request.</p>
also be used in DataTable's <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a>
option).</p> </div>
<p>The example below shows <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> being
used with the <code>type</code> option set to <code class="string" title="String">POST</code> to make a POST request.</p>
</div> <table id="example" class="display" cellspacing="0" width="100%"><thead><tr><th>First name</th><th>Last name</th><th>Position</th><th>Office</th><th>Start date</th><th>Salary</th></tr></thead><tfoot><tr><th>First name</th><th>Last name</th><th>Position</th><th>Office</th><th>Start date</th><th>Salary</th></tr></tfoot></table>
<table id="example" class="display" cellspacing="0" width="100%">
<thead> <ul class="tabs">
<tr> <li class="active">Javascript</li>
<th>First name</th> <li>HTML</li>
<th>Last name</th> <li>CSS</li>
<th>Position</th> <li>Ajax</li>
<th>Office</th> <li>Server-side script</li>
<th>Start date</th> </ul>
<th>Salary</th>
</tr> <div class="tabs">
</thead> <div class="js">
<tfoot> <p>The Javascript shown below is used to initialise the table shown in this example:</p>
<tr> <code class="multiline language-js">$(document).ready(function() {
<th>First name</th>
<th>Last name</th>
<th>Position</th>
<th>Office</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
&quot;processing&quot;: true, &quot;processing&quot;: true,
&quot;serverSide&quot;: true, &quot;serverSide&quot;: true,
@ -107,366 +81,153 @@ $(document).ready(function() {
] ]
} ); } );
} );</code> } );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul> <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<li> <ul><li><a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a></li><li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li></ul>
<a href="//code.jquery.com/jquery-1.12.3.js">//code.jquery.com/jquery-1.12.3.js</a> </div>
</li> <div class="table">
<li> <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
<a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a> </div>
</li> <div class="css">
</ul> <div>
</div> <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 additional CSS used is shown below:</p>
<div class="table"> <code class="multiline language-css"></code>
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p> </div>
</div>
<div class="css"> <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<div> <ul><li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li></ul>
<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 </div>
additional CSS used is shown below:</p><code class="multiline language-css"></code> <div class="ajax">
<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 loaded.</p>
</div>
<div class="php">
<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 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables documentation</a>.</p>
</div> </div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a>
</li>
</ul>
</div> </div>
<div class="ajax"> </section>
<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
loaded.</p>
</div> </div>
<div class="php">
<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 <section>
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables <div class="footer">
documentation</a>.</p> <div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group"><h3><a href="../basic_init/index.html
">Basic initialisation</a></h3><ul class="toc"><li><a href="../basic_init/zero_configuration.html
">Zero configuration</a></li><li><a href="../basic_init/filter_only.html
">Feature enable / disable</a></li><li><a href="../basic_init/table_sorting.html
">Default ordering (sorting)</a></li><li><a href="../basic_init/multi_col_sort.html
">Multi-column ordering</a></li><li><a href="../basic_init/multiple_tables.html
">Multiple tables</a></li><li><a href="../basic_init/hidden_columns.html
">Hidden columns</a></li><li><a href="../basic_init/complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="../basic_init/dom.html
">DOM positioning</a></li><li><a href="../basic_init/flexible_width.html
">Flexible table width</a></li><li><a href="../basic_init/state_save.html
">State saving</a></li><li><a href="../basic_init/alt_pagination.html
">Alternative pagination</a></li><li><a href="../basic_init/scroll_y.html
">Scroll - vertical</a></li><li><a href="../basic_init/scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="../basic_init/scroll_x.html
">Scroll - horizontal</a></li><li><a href="../basic_init/scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="../basic_init/comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="../basic_init/language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="../advanced_init/index.html
">Advanced initialisation</a></h3><ul class="toc"><li><a href="../advanced_init/events_live.html
">DOM / jQuery events</a></li><li><a href="../advanced_init/dt_events.html
">DataTables events</a></li><li><a href="../advanced_init/column_render.html
">Column rendering</a></li><li><a href="../advanced_init/length_menu.html
">Page length options</a></li><li><a href="../advanced_init/dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="../advanced_init/complex_header.html
">Complex headers with column visibility</a></li><li><a href="../advanced_init/object_dom_read.html
">Read HTML to data objects</a></li><li><a href="../advanced_init/html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="../advanced_init/html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="../advanced_init/language_file.html
">Language file</a></li><li><a href="../advanced_init/defaults.html
">Setting defaults</a></li><li><a href="../advanced_init/row_callback.html
">Row created callback</a></li><li><a href="../advanced_init/row_grouping.html
">Row grouping</a></li><li><a href="../advanced_init/footer_callback.html
">Footer callback</a></li><li><a href="../advanced_init/dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="../advanced_init/sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="../styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="../styling/display.html
">Base style</a></li><li><a href="../styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="../styling/cell-border.html
">Base style - cell borders</a></li><li><a href="../styling/compact.html
">Base style - compact</a></li><li><a href="../styling/hover.html
">Base style - hover</a></li><li><a href="../styling/order-column.html
">Base style - order-column</a></li><li><a href="../styling/row-border.html
">Base style - row borders</a></li><li><a href="../styling/stripe.html
">Base style - stripe</a></li><li><a href="../styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="../styling/foundation.html
">Foundation</a></li><li><a href="../styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="../styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="../styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="../styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="../styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="../data_sources/index.html
">Data sources</a></h3><ul class="toc"><li><a href="../data_sources/dom.html
">HTML (DOM) sourced data</a></li><li><a href="../data_sources/ajax.html
">Ajax sourced data</a></li><li><a href="../data_sources/js_array.html
">Javascript sourced data</a></li><li><a href="../data_sources/server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="../api/index.html
">API</a></h3><ul class="toc"><li><a href="../api/add_row.html
">Add rows</a></li><li><a href="../api/multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="../api/multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="../api/highlight.html
">Highlighting rows and columns</a></li><li><a href="../api/row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="../api/select_row.html
">Row selection (multiple rows)</a></li><li><a href="../api/select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="../api/form.html
">Form inputs</a></li><li><a href="../api/counter_columns.html
">Index column</a></li><li><a href="../api/show_hide.html
">Show / hide columns dynamically</a></li><li><a href="../api/api_in_init.html
">Using API in callbacks</a></li><li><a href="../api/tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="../api/regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="../ajax/index.html
">Ajax</a></h3><ul class="toc"><li><a href="../ajax/simple.html
">Ajax data source (arrays)</a></li><li><a href="../ajax/objects.html
">Ajax data source (objects)</a></li><li><a href="../ajax/deep.html
">Nested object data (objects)</a></li><li><a href="../ajax/objects_subarrays.html
">Nested object data (arrays)</a></li><li><a href="../ajax/orthogonal-data.html
">Orthogonal data</a></li><li><a href="../ajax/null_data_source.html
">Generated content for a column</a></li><li><a href="../ajax/custom_data_property.html
">Custom data source property</a></li><li><a href="../ajax/custom_data_flat.html
">Flat array data source</a></li><li><a href="../ajax/defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="./index.html
">Server-side</a></h3><ul class="toc active"><li><a href="./simple.html
">Server-side processing</a></li><li><a href="./custom_vars.html
">Custom HTTP variables</a></li><li class="active"><a href="./post.html
">POST data</a></li><li><a href="./ids.html
">Automatic addition of row ID attributes</a></li><li><a href="./object_data.html
">Object data source</a></li><li><a href="./row_details.html
">Row details</a></li><li><a href="./select_rows.html
">Row selection</a></li><li><a href="./jsonp.html
">JSONP data source for remote domains</a></li><li><a href="./defer_loading.html
">Deferred loading of data</a></li><li><a href="./pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="../plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="../plug-ins/api.html
">API plug-in methods</a></li><li><a href="../plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="../plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="../plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="../plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div> </div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="../basic_init/index.html">Basic initialisation</a></h3>
<ul class="toc">
<li>
<a href="../basic_init/zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="../basic_init/filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="../basic_init/table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="../basic_init/multi_col_sort.html">Multi-column ordering</a>
</li>
<li>
<a href="../basic_init/multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="../basic_init/hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="../basic_init/complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="../basic_init/dom.html">DOM positioning</a>
</li>
<li>
<a href="../basic_init/flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="../basic_init/state_save.html">State saving</a>
</li>
<li>
<a href="../basic_init/alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="../basic_init/scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="../basic_init/scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="../basic_init/scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="../basic_init/scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="../basic_init/comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="../basic_init/language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../advanced_init/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="../advanced_init/events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="../advanced_init/dt_events.html">DataTables events</a>
</li>
<li>
<a href="../advanced_init/column_render.html">Column rendering</a>
</li>
<li>
<a href="../advanced_init/length_menu.html">Page length options</a>
</li>
<li>
<a href="../advanced_init/dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="../advanced_init/complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="../advanced_init/object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="../advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="../advanced_init/language_file.html">Language file</a>
</li>
<li>
<a href="../advanced_init/defaults.html">Setting defaults</a>
</li>
<li>
<a href="../advanced_init/row_callback.html">Row created callback</a>
</li>
<li>
<a href="../advanced_init/row_grouping.html">Row grouping</a>
</li>
<li>
<a href="../advanced_init/footer_callback.html">Footer callback</a>
</li>
<li>
<a href="../advanced_init/dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="../advanced_init/sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/display.html">Base style</a>
</li>
<li>
<a href="../styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="../styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="../styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="../styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="../styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="../styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="../styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="../styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="../styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../data_sources/index.html">Data sources</a></h3>
<ul class="toc">
<li>
<a href="../data_sources/dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="../data_sources/ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="../data_sources/js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="../data_sources/server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="../api/add_row.html">Add rows</a>
</li>
<li>
<a href="../api/multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="../api/multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="../api/highlight.html">Highlighting rows and columns</a>
</li>
<li>
<a href="../api/row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="../api/select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="../api/select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="../api/form.html">Form inputs</a>
</li>
<li>
<a href="../api/counter_columns.html">Index column</a>
</li>
<li>
<a href="../api/show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="../api/api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="../api/tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="../api/regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../ajax/index.html">Ajax</a></h3>
<ul class="toc">
<li>
<a href="../ajax/simple.html">Ajax data source (arrays)</a>
</li>
<li>
<a href="../ajax/objects.html">Ajax data source (objects)</a>
</li>
<li>
<a href="../ajax/deep.html">Nested object data (objects)</a>
</li>
<li>
<a href="../ajax/objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="../ajax/orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="../ajax/null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="../ajax/custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="../ajax/custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="../ajax/defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./index.html">Server-side</a></h3>
<ul class="toc active">
<li>
<a href="./simple.html">Server-side processing</a>
</li>
<li>
<a href="./custom_vars.html">Custom HTTP variables</a>
</li>
<li class="active">
<a href="./post.html">POST data</a>
</li>
<li>
<a href="./ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="./object_data.html">Object data source</a>
</li>
<li>
<a href="./row_details.html">Row details</a>
</li>
<li>
<a href="./select_rows.html">Row selection</a>
</li>
<li>
<a href="./jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="./defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="./pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="../plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="../plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

View File

@ -1,15 +1,15 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<title>DataTables example - Row details</title>
<link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"> <title>DataTables example - Row details</title>
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"><link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<style type="text/css" class="init"> <style type="text/css" class="init">
td.details-control { td.details-control {
background: url('../resources/details_open.png') no-repeat center center; background: url('../resources/details_open.png') no-repeat center center;
cursor: pointer; cursor: pointer;
@ -18,17 +18,10 @@ tr.details td.details-control {
background: url('../resources/details_close.png') no-repeat center center; background: url('../resources/details_close.png') no-repeat center center;
} }
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <script type="text/javascript" language="javascript" class="init">
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
function format ( d ) { function format ( d ) {
return 'Full name: '+d.first_name+' '+d.last_name+'<br>'+ return 'Full name: '+d.first_name+' '+d.last_name+'<br>'+
@ -90,59 +83,38 @@ $(document).ready(function() {
} ); } );
} ); } );
</script> </script>
</head> </head>
<body class="dt-example"> <body class="dt-example ">
<div class="container"> <div class="container">
<section> <section>
<h1>DataTables example <span>Row details</span></h1> <h1>DataTables example <span>Row details</span></h1>
<div class="info"> <div class="info">
<p>This example shows the use of DataTables' ability to show and hide child rows which are attached to a parent row in the host table. This is often used to show <p>This example shows the use of DataTables' ability to show and hide child rows which are attached to a parent row in the host table. This is often used to show additional information about a row, particularly when you wish to convey more information about a row than there is space for in the host table.</p>
additional information about a row, particularly when you wish to convey more information about a row than there is space for in the host table.</p>
<p>The example below shows server-side processing being used with the first column having an event listener attached to it which will toggle the child row's <p>The example below shows server-side processing being used with the first column having an event listener attached to it which will toggle the child row's display. This is set up using <a href="//datatables.net/reference/option/columns.data"><code class="option" title="DataTables initialisation option">columns.data</code></a> and <a href="//datatables.net/reference/option/columns.defaultContent"><code class="option" title="DataTables initialisation option">columns.defaultContent</code></a>, in combination with CSS to show an empty cell with a background image which can be clicked upon.</p>
display. This is set up using <a href="//datatables.net/reference/option/columns.data"><code class="option" title=
"DataTables initialisation option">columns.data</code></a> and <a href="//datatables.net/reference/option/columns.defaultContent"><code class="option" title= <p>The event handler makes use of the <a href="//datatables.net/reference/api/row().child"><code class="api" title="DataTables API method">row().child</code></a> methods to firstly check if a row is already displayed, and if so hide it, if not show it. The content of the child row is, in this example, defined by the <code>format()</code> function, but you would replace that with whatever you wanted to show the content required, possibly including, for example, an Ajax call to the server to obtain the extra information to show. Note that the format details function has access to the full data source object for the row, including information that is not actually shown in the table (the salary parameter for example).</p>
"DataTables initialisation option">columns.defaultContent</code></a>, in combination with CSS to show an empty cell with a background image which can be clicked
upon.</p> <p>Furthermore, this example shows a small difference from the <a href="../api/row_details.html">client-side row details example</a> in that to have rows automatically reopen when the table is redrawn, we need to track a unique identifier for each row - in this case the row <code>id</code>. This is required because in server-side processing mode rows are automatically destroyed and recreated on each draw.</p>
<p>The event handler makes use of the <a href="//datatables.net/reference/api/row().child"><code class="api" title="DataTables API method">row().child</code></a>
methods to firstly check if a row is already displayed, and if so hide it, if not show it. The content of the child row is, in this example, defined by the </div>
<code>format()</code> function, but you would replace that with whatever you wanted to show the content required, possibly including, for example, an Ajax call to
the server to obtain the extra information to show. Note that the format details function has access to the full data source object for the row, including
information that is not actually shown in the table (the salary parameter for example).</p> <table id="example" class="display" cellspacing="0" width="100%"><thead><tr><th></th><th>First name</th><th>Last name</th><th>Position</th><th>Office</th></tr></thead><tfoot><tr><th></th><th>First name</th><th>Last name</th><th>Position</th><th>Office</th></tr></tfoot></table>
<p>Furthermore, this example shows a small difference from the <a href="../api/row_details.html">client-side row details example</a> in that to have rows
automatically reopen when the table is redrawn, we need to track a unique identifier for each row - in this case the row <code>id</code>. This is required because <ul class="tabs">
in server-side processing mode rows are automatically destroyed and recreated on each draw.</p> <li class="active">Javascript</li>
</div> <li>HTML</li>
<table id="example" class="display" cellspacing="0" width="100%"> <li>CSS</li>
<thead> <li>Ajax</li>
<tr> <li>Server-side script</li>
<th></th> </ul>
<th>First name</th>
<th>Last name</th> <div class="tabs">
<th>Position</th> <div class="js">
<th>Office</th> <p>The Javascript shown below is used to initialise the table shown in this example:</p>
</tr> <code class="multiline language-js">function format ( d ) {
</thead>
<tfoot>
<tr>
<th></th>
<th>First name</th>
<th>Last name</th>
<th>Position</th>
<th>Office</th>
</tr>
</tfoot>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">function format ( d ) {
return 'Full name: '+d.first_name+' '+d.last_name+'&lt;br&gt;'+ return 'Full name: '+d.first_name+' '+d.last_name+'&lt;br&gt;'+
'Salary: '+d.salary+'&lt;br&gt;'+ 'Salary: '+d.salary+'&lt;br&gt;'+
'The child row can contain any data you wish, including links, images, inner tables etc.'; 'The child row can contain any data you wish, including links, images, inner tables etc.';
@ -201,372 +173,159 @@ $(document).ready(function() {
} ); } );
} ); } );
} );</code> } );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul> <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<li> <ul><li><a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a></li><li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li></ul>
<a href="//code.jquery.com/jquery-1.12.3.js">//code.jquery.com/jquery-1.12.3.js</a> </div>
</li> <div class="table">
<li> <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
<a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a> </div>
</li> <div class="css">
</ul> <div>
</div> <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 additional CSS used is shown below:</p>
<div class="table"> <code class="multiline language-css">td.details-control {
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
</div>
<div class="css">
<div>
<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
additional CSS used is shown below:</p><code class="multiline language-css">td.details-control {
background: url('../resources/details_open.png') no-repeat center center; background: url('../resources/details_open.png') no-repeat center center;
cursor: pointer; cursor: pointer;
} }
tr.details td.details-control { tr.details td.details-control {
background: url('../resources/details_close.png') no-repeat center center; background: url('../resources/details_close.png') no-repeat center center;
}</code> }</code>
</div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul><li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li></ul>
</div>
<div class="ajax">
<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 loaded.</p>
</div>
<div class="php">
<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 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables documentation</a>.</p>
</div> </div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a>
</li>
</ul>
</div> </div>
<div class="ajax"> </section>
<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
loaded.</p>
</div> </div>
<div class="php">
<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 <section>
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables <div class="footer">
documentation</a>.</p> <div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group"><h3><a href="../basic_init/index.html
">Basic initialisation</a></h3><ul class="toc"><li><a href="../basic_init/zero_configuration.html
">Zero configuration</a></li><li><a href="../basic_init/filter_only.html
">Feature enable / disable</a></li><li><a href="../basic_init/table_sorting.html
">Default ordering (sorting)</a></li><li><a href="../basic_init/multi_col_sort.html
">Multi-column ordering</a></li><li><a href="../basic_init/multiple_tables.html
">Multiple tables</a></li><li><a href="../basic_init/hidden_columns.html
">Hidden columns</a></li><li><a href="../basic_init/complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="../basic_init/dom.html
">DOM positioning</a></li><li><a href="../basic_init/flexible_width.html
">Flexible table width</a></li><li><a href="../basic_init/state_save.html
">State saving</a></li><li><a href="../basic_init/alt_pagination.html
">Alternative pagination</a></li><li><a href="../basic_init/scroll_y.html
">Scroll - vertical</a></li><li><a href="../basic_init/scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="../basic_init/scroll_x.html
">Scroll - horizontal</a></li><li><a href="../basic_init/scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="../basic_init/comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="../basic_init/language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="../advanced_init/index.html
">Advanced initialisation</a></h3><ul class="toc"><li><a href="../advanced_init/events_live.html
">DOM / jQuery events</a></li><li><a href="../advanced_init/dt_events.html
">DataTables events</a></li><li><a href="../advanced_init/column_render.html
">Column rendering</a></li><li><a href="../advanced_init/length_menu.html
">Page length options</a></li><li><a href="../advanced_init/dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="../advanced_init/complex_header.html
">Complex headers with column visibility</a></li><li><a href="../advanced_init/object_dom_read.html
">Read HTML to data objects</a></li><li><a href="../advanced_init/html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="../advanced_init/html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="../advanced_init/language_file.html
">Language file</a></li><li><a href="../advanced_init/defaults.html
">Setting defaults</a></li><li><a href="../advanced_init/row_callback.html
">Row created callback</a></li><li><a href="../advanced_init/row_grouping.html
">Row grouping</a></li><li><a href="../advanced_init/footer_callback.html
">Footer callback</a></li><li><a href="../advanced_init/dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="../advanced_init/sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="../styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="../styling/display.html
">Base style</a></li><li><a href="../styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="../styling/cell-border.html
">Base style - cell borders</a></li><li><a href="../styling/compact.html
">Base style - compact</a></li><li><a href="../styling/hover.html
">Base style - hover</a></li><li><a href="../styling/order-column.html
">Base style - order-column</a></li><li><a href="../styling/row-border.html
">Base style - row borders</a></li><li><a href="../styling/stripe.html
">Base style - stripe</a></li><li><a href="../styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="../styling/foundation.html
">Foundation</a></li><li><a href="../styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="../styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="../styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="../styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="../styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="../data_sources/index.html
">Data sources</a></h3><ul class="toc"><li><a href="../data_sources/dom.html
">HTML (DOM) sourced data</a></li><li><a href="../data_sources/ajax.html
">Ajax sourced data</a></li><li><a href="../data_sources/js_array.html
">Javascript sourced data</a></li><li><a href="../data_sources/server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="../api/index.html
">API</a></h3><ul class="toc"><li><a href="../api/add_row.html
">Add rows</a></li><li><a href="../api/multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="../api/multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="../api/highlight.html
">Highlighting rows and columns</a></li><li><a href="../api/row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="../api/select_row.html
">Row selection (multiple rows)</a></li><li><a href="../api/select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="../api/form.html
">Form inputs</a></li><li><a href="../api/counter_columns.html
">Index column</a></li><li><a href="../api/show_hide.html
">Show / hide columns dynamically</a></li><li><a href="../api/api_in_init.html
">Using API in callbacks</a></li><li><a href="../api/tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="../api/regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="../ajax/index.html
">Ajax</a></h3><ul class="toc"><li><a href="../ajax/simple.html
">Ajax data source (arrays)</a></li><li><a href="../ajax/objects.html
">Ajax data source (objects)</a></li><li><a href="../ajax/deep.html
">Nested object data (objects)</a></li><li><a href="../ajax/objects_subarrays.html
">Nested object data (arrays)</a></li><li><a href="../ajax/orthogonal-data.html
">Orthogonal data</a></li><li><a href="../ajax/null_data_source.html
">Generated content for a column</a></li><li><a href="../ajax/custom_data_property.html
">Custom data source property</a></li><li><a href="../ajax/custom_data_flat.html
">Flat array data source</a></li><li><a href="../ajax/defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="./index.html
">Server-side</a></h3><ul class="toc active"><li><a href="./simple.html
">Server-side processing</a></li><li><a href="./custom_vars.html
">Custom HTTP variables</a></li><li><a href="./post.html
">POST data</a></li><li><a href="./ids.html
">Automatic addition of row ID attributes</a></li><li><a href="./object_data.html
">Object data source</a></li><li class="active"><a href="./row_details.html
">Row details</a></li><li><a href="./select_rows.html
">Row selection</a></li><li><a href="./jsonp.html
">JSONP data source for remote domains</a></li><li><a href="./defer_loading.html
">Deferred loading of data</a></li><li><a href="./pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="../plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="../plug-ins/api.html
">API plug-in methods</a></li><li><a href="../plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="../plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="../plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="../plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div> </div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="../basic_init/index.html">Basic initialisation</a></h3>
<ul class="toc">
<li>
<a href="../basic_init/zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="../basic_init/filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="../basic_init/table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="../basic_init/multi_col_sort.html">Multi-column ordering</a>
</li>
<li>
<a href="../basic_init/multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="../basic_init/hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="../basic_init/complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="../basic_init/dom.html">DOM positioning</a>
</li>
<li>
<a href="../basic_init/flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="../basic_init/state_save.html">State saving</a>
</li>
<li>
<a href="../basic_init/alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="../basic_init/scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="../basic_init/scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="../basic_init/scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="../basic_init/scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="../basic_init/comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="../basic_init/language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../advanced_init/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="../advanced_init/events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="../advanced_init/dt_events.html">DataTables events</a>
</li>
<li>
<a href="../advanced_init/column_render.html">Column rendering</a>
</li>
<li>
<a href="../advanced_init/length_menu.html">Page length options</a>
</li>
<li>
<a href="../advanced_init/dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="../advanced_init/complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="../advanced_init/object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="../advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="../advanced_init/language_file.html">Language file</a>
</li>
<li>
<a href="../advanced_init/defaults.html">Setting defaults</a>
</li>
<li>
<a href="../advanced_init/row_callback.html">Row created callback</a>
</li>
<li>
<a href="../advanced_init/row_grouping.html">Row grouping</a>
</li>
<li>
<a href="../advanced_init/footer_callback.html">Footer callback</a>
</li>
<li>
<a href="../advanced_init/dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="../advanced_init/sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/display.html">Base style</a>
</li>
<li>
<a href="../styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="../styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="../styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="../styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="../styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="../styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="../styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="../styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="../styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../data_sources/index.html">Data sources</a></h3>
<ul class="toc">
<li>
<a href="../data_sources/dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="../data_sources/ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="../data_sources/js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="../data_sources/server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="../api/add_row.html">Add rows</a>
</li>
<li>
<a href="../api/multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="../api/multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="../api/highlight.html">Highlighting rows and columns</a>
</li>
<li>
<a href="../api/row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="../api/select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="../api/select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="../api/form.html">Form inputs</a>
</li>
<li>
<a href="../api/counter_columns.html">Index column</a>
</li>
<li>
<a href="../api/show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="../api/api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="../api/tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="../api/regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../ajax/index.html">Ajax</a></h3>
<ul class="toc">
<li>
<a href="../ajax/simple.html">Ajax data source (arrays)</a>
</li>
<li>
<a href="../ajax/objects.html">Ajax data source (objects)</a>
</li>
<li>
<a href="../ajax/deep.html">Nested object data (objects)</a>
</li>
<li>
<a href="../ajax/objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="../ajax/orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="../ajax/null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="../ajax/custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="../ajax/custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="../ajax/defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./index.html">Server-side</a></h3>
<ul class="toc active">
<li>
<a href="./simple.html">Server-side processing</a>
</li>
<li>
<a href="./custom_vars.html">Custom HTTP variables</a>
</li>
<li>
<a href="./post.html">POST data</a>
</li>
<li>
<a href="./ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="./object_data.html">Object data source</a>
</li>
<li class="active">
<a href="./row_details.html">Row details</a>
</li>
<li>
<a href="./select_rows.html">Row selection</a>
</li>
<li>
<a href="./jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="./defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="./pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="../plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="../plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

View File

@ -242,7 +242,7 @@ class SSP {
// Main query to actually get the data // Main query to actually get the data
$data = self::sql_exec( $db, $bindings, $data = self::sql_exec( $db, $bindings,
"SELECT `".implode("`, `", self::pluck($columns, 'db'))."` "SELECT SQL_CALC_FOUND_ROWS `".implode("`, `", self::pluck($columns, 'db'))."`
FROM `$table` FROM `$table`
$where $where
$order $order
@ -250,10 +250,8 @@ class SSP {
); );
// Data set length after filtering // Data set length after filtering
$resFilterLength = self::sql_exec( $db, $bindings, $resFilterLength = self::sql_exec( $db,
"SELECT COUNT(`{$primaryKey}`) "SELECT FOUND_ROWS()"
FROM `$table`
$where"
); );
$recordsFiltered = $resFilterLength[0][0]; $recordsFiltered = $resFilterLength[0][0];
@ -264,6 +262,7 @@ class SSP {
); );
$recordsTotal = $resTotalLength[0][0]; $recordsTotal = $resTotalLength[0][0];
/* /*
* Output * Output
*/ */
@ -333,7 +332,7 @@ class SSP {
// Main query to actually get the data // Main query to actually get the data
$data = self::sql_exec( $db, $bindings, $data = self::sql_exec( $db, $bindings,
"SELECT `".implode("`, `", self::pluck($columns, 'db'))."` "SELECT SQL_CALC_FOUND_ROWS `".implode("`, `", self::pluck($columns, 'db'))."`
FROM `$table` FROM `$table`
$where $where
$order $order
@ -341,10 +340,8 @@ class SSP {
); );
// Data set length after filtering // Data set length after filtering
$resFilterLength = self::sql_exec( $db, $bindings, $resFilterLength = self::sql_exec( $db,
"SELECT COUNT(`{$primaryKey}`) "SELECT FOUND_ROWS()"
FROM `$table`
$where"
); );
$recordsFiltered = $resFilterLength[0][0]; $recordsFiltered = $resFilterLength[0][0];

View File

@ -1,26 +1,19 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<title>DataTables example - Row selection</title>
<link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"> <title>DataTables example - Row selection</title>
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"><link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<style type="text/css" class="init"> <style type="text/css" class="init">
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <script type="text/javascript" language="javascript" class="init">
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() { $(document).ready(function() {
var selected = []; var selected = [];
@ -51,53 +44,36 @@ $(document).ready(function() {
} ); } );
</script> </script>
</head> </head>
<body class="dt-example"> <body class="dt-example ">
<div class="container"> <div class="container">
<section> <section>
<h1>DataTables example <span>Row selection</span></h1> <h1>DataTables example <span>Row selection</span></h1>
<div class="info"> <div class="info">
<p>When you want to have user selectable rows in DataTables, it is relatively trivial when using DOM based data - but when using server-side processing, DataTables <p>When you want to have user selectable rows in DataTables, it is relatively trivial when using DOM based data - but when using server-side processing, DataTables doesn't retain DOM row elements over pages / filtering etc. As such, you will need to keep a track of which rows a user as selected and mark them as selected on each draw.</p>
doesn't retain DOM row elements over pages / filtering etc. As such, you will need to keep a track of which rows a user as selected and mark them as selected on
each draw.</p> <p>This is shown in this demo, which uses a unique ID assigned to the TR element (this is done automatically through the use of the <code>DT_RowId</code> special property returned as part of the object given by the server for each row) to track which rows are selected and reselect them is appropriate on a draw.</p>
<p>This is shown in this demo, which uses a unique ID assigned to the TR element (this is done automatically through the use of the <code>DT_RowId</code> special
property returned as part of the object given by the server for each row) to track which rows are selected and reselect them is appropriate on a draw.</p> <p>If you are looking for a more complete and easier to use row selection option, check out the <a href="https://datatables.net/extras/select">Select extension</a> provides an API that is fully integrated with DataTables for selecting rows and acting upon those selected rows.</p>
<p>If you are looking for a more complete and easier to use row selection option, check out the <a href="https://datatables.net/extras/select">Select extension</a>
provides an API that is fully integrated with DataTables for selecting rows and acting upon those selected rows.</p> </div>
</div>
<table id="example" class="display" cellspacing="0" width="100%">
<thead> <table id="example" class="display" cellspacing="0" width="100%"><thead><tr><th>First name</th><th>Last name</th><th>Position</th><th>Office</th><th>Start date</th><th>Salary</th></tr></thead><tfoot><tr><th>First name</th><th>Last name</th><th>Position</th><th>Office</th><th>Start date</th><th>Salary</th></tr></tfoot></table>
<tr>
<th>First name</th> <ul class="tabs">
<th>Last name</th> <li class="active">Javascript</li>
<th>Position</th> <li>HTML</li>
<th>Office</th> <li>CSS</li>
<th>Start date</th> <li>Ajax</li>
<th>Salary</th> <li>Server-side script</li>
</tr> </ul>
</thead>
<tfoot> <div class="tabs">
<tr> <div class="js">
<th>First name</th> <p>The Javascript shown below is used to initialise the table shown in this example:</p>
<th>Last name</th> <code class="multiline language-js">$(document).ready(function() {
<th>Position</th>
<th>Office</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
var selected = []; var selected = [];
$(&quot;#example&quot;).DataTable({ $(&quot;#example&quot;).DataTable({
@ -124,366 +100,153 @@ $(document).ready(function() {
$(this).toggleClass('selected'); $(this).toggleClass('selected');
} ); } );
} );</code> } );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul> <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<li> <ul><li><a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a></li><li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li></ul>
<a href="//code.jquery.com/jquery-1.12.3.js">//code.jquery.com/jquery-1.12.3.js</a> </div>
</li> <div class="table">
<li> <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
<a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a> </div>
</li> <div class="css">
</ul> <div>
</div> <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 additional CSS used is shown below:</p>
<div class="table"> <code class="multiline language-css"></code>
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p> </div>
</div>
<div class="css"> <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<div> <ul><li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li></ul>
<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 </div>
additional CSS used is shown below:</p><code class="multiline language-css"></code> <div class="ajax">
<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 loaded.</p>
</div>
<div class="php">
<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 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables documentation</a>.</p>
</div> </div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a>
</li>
</ul>
</div> </div>
<div class="ajax"> </section>
<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
loaded.</p>
</div> </div>
<div class="php">
<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 <section>
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables <div class="footer">
documentation</a>.</p> <div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group"><h3><a href="../basic_init/index.html
">Basic initialisation</a></h3><ul class="toc"><li><a href="../basic_init/zero_configuration.html
">Zero configuration</a></li><li><a href="../basic_init/filter_only.html
">Feature enable / disable</a></li><li><a href="../basic_init/table_sorting.html
">Default ordering (sorting)</a></li><li><a href="../basic_init/multi_col_sort.html
">Multi-column ordering</a></li><li><a href="../basic_init/multiple_tables.html
">Multiple tables</a></li><li><a href="../basic_init/hidden_columns.html
">Hidden columns</a></li><li><a href="../basic_init/complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="../basic_init/dom.html
">DOM positioning</a></li><li><a href="../basic_init/flexible_width.html
">Flexible table width</a></li><li><a href="../basic_init/state_save.html
">State saving</a></li><li><a href="../basic_init/alt_pagination.html
">Alternative pagination</a></li><li><a href="../basic_init/scroll_y.html
">Scroll - vertical</a></li><li><a href="../basic_init/scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="../basic_init/scroll_x.html
">Scroll - horizontal</a></li><li><a href="../basic_init/scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="../basic_init/comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="../basic_init/language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="../advanced_init/index.html
">Advanced initialisation</a></h3><ul class="toc"><li><a href="../advanced_init/events_live.html
">DOM / jQuery events</a></li><li><a href="../advanced_init/dt_events.html
">DataTables events</a></li><li><a href="../advanced_init/column_render.html
">Column rendering</a></li><li><a href="../advanced_init/length_menu.html
">Page length options</a></li><li><a href="../advanced_init/dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="../advanced_init/complex_header.html
">Complex headers with column visibility</a></li><li><a href="../advanced_init/object_dom_read.html
">Read HTML to data objects</a></li><li><a href="../advanced_init/html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="../advanced_init/html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="../advanced_init/language_file.html
">Language file</a></li><li><a href="../advanced_init/defaults.html
">Setting defaults</a></li><li><a href="../advanced_init/row_callback.html
">Row created callback</a></li><li><a href="../advanced_init/row_grouping.html
">Row grouping</a></li><li><a href="../advanced_init/footer_callback.html
">Footer callback</a></li><li><a href="../advanced_init/dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="../advanced_init/sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="../styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="../styling/display.html
">Base style</a></li><li><a href="../styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="../styling/cell-border.html
">Base style - cell borders</a></li><li><a href="../styling/compact.html
">Base style - compact</a></li><li><a href="../styling/hover.html
">Base style - hover</a></li><li><a href="../styling/order-column.html
">Base style - order-column</a></li><li><a href="../styling/row-border.html
">Base style - row borders</a></li><li><a href="../styling/stripe.html
">Base style - stripe</a></li><li><a href="../styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="../styling/foundation.html
">Foundation</a></li><li><a href="../styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="../styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="../styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="../styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="../styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="../data_sources/index.html
">Data sources</a></h3><ul class="toc"><li><a href="../data_sources/dom.html
">HTML (DOM) sourced data</a></li><li><a href="../data_sources/ajax.html
">Ajax sourced data</a></li><li><a href="../data_sources/js_array.html
">Javascript sourced data</a></li><li><a href="../data_sources/server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="../api/index.html
">API</a></h3><ul class="toc"><li><a href="../api/add_row.html
">Add rows</a></li><li><a href="../api/multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="../api/multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="../api/highlight.html
">Highlighting rows and columns</a></li><li><a href="../api/row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="../api/select_row.html
">Row selection (multiple rows)</a></li><li><a href="../api/select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="../api/form.html
">Form inputs</a></li><li><a href="../api/counter_columns.html
">Index column</a></li><li><a href="../api/show_hide.html
">Show / hide columns dynamically</a></li><li><a href="../api/api_in_init.html
">Using API in callbacks</a></li><li><a href="../api/tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="../api/regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="../ajax/index.html
">Ajax</a></h3><ul class="toc"><li><a href="../ajax/simple.html
">Ajax data source (arrays)</a></li><li><a href="../ajax/objects.html
">Ajax data source (objects)</a></li><li><a href="../ajax/deep.html
">Nested object data (objects)</a></li><li><a href="../ajax/objects_subarrays.html
">Nested object data (arrays)</a></li><li><a href="../ajax/orthogonal-data.html
">Orthogonal data</a></li><li><a href="../ajax/null_data_source.html
">Generated content for a column</a></li><li><a href="../ajax/custom_data_property.html
">Custom data source property</a></li><li><a href="../ajax/custom_data_flat.html
">Flat array data source</a></li><li><a href="../ajax/defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="./index.html
">Server-side</a></h3><ul class="toc active"><li><a href="./simple.html
">Server-side processing</a></li><li><a href="./custom_vars.html
">Custom HTTP variables</a></li><li><a href="./post.html
">POST data</a></li><li><a href="./ids.html
">Automatic addition of row ID attributes</a></li><li><a href="./object_data.html
">Object data source</a></li><li><a href="./row_details.html
">Row details</a></li><li class="active"><a href="./select_rows.html
">Row selection</a></li><li><a href="./jsonp.html
">JSONP data source for remote domains</a></li><li><a href="./defer_loading.html
">Deferred loading of data</a></li><li><a href="./pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="../plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="../plug-ins/api.html
">API plug-in methods</a></li><li><a href="../plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="../plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="../plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="../plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div> </div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="../basic_init/index.html">Basic initialisation</a></h3>
<ul class="toc">
<li>
<a href="../basic_init/zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="../basic_init/filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="../basic_init/table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="../basic_init/multi_col_sort.html">Multi-column ordering</a>
</li>
<li>
<a href="../basic_init/multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="../basic_init/hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="../basic_init/complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="../basic_init/dom.html">DOM positioning</a>
</li>
<li>
<a href="../basic_init/flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="../basic_init/state_save.html">State saving</a>
</li>
<li>
<a href="../basic_init/alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="../basic_init/scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="../basic_init/scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="../basic_init/scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="../basic_init/scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="../basic_init/comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="../basic_init/language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../advanced_init/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="../advanced_init/events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="../advanced_init/dt_events.html">DataTables events</a>
</li>
<li>
<a href="../advanced_init/column_render.html">Column rendering</a>
</li>
<li>
<a href="../advanced_init/length_menu.html">Page length options</a>
</li>
<li>
<a href="../advanced_init/dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="../advanced_init/complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="../advanced_init/object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="../advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="../advanced_init/language_file.html">Language file</a>
</li>
<li>
<a href="../advanced_init/defaults.html">Setting defaults</a>
</li>
<li>
<a href="../advanced_init/row_callback.html">Row created callback</a>
</li>
<li>
<a href="../advanced_init/row_grouping.html">Row grouping</a>
</li>
<li>
<a href="../advanced_init/footer_callback.html">Footer callback</a>
</li>
<li>
<a href="../advanced_init/dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="../advanced_init/sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/display.html">Base style</a>
</li>
<li>
<a href="../styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="../styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="../styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="../styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="../styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="../styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="../styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="../styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="../styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../data_sources/index.html">Data sources</a></h3>
<ul class="toc">
<li>
<a href="../data_sources/dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="../data_sources/ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="../data_sources/js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="../data_sources/server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="../api/add_row.html">Add rows</a>
</li>
<li>
<a href="../api/multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="../api/multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="../api/highlight.html">Highlighting rows and columns</a>
</li>
<li>
<a href="../api/row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="../api/select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="../api/select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="../api/form.html">Form inputs</a>
</li>
<li>
<a href="../api/counter_columns.html">Index column</a>
</li>
<li>
<a href="../api/show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="../api/api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="../api/tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="../api/regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../ajax/index.html">Ajax</a></h3>
<ul class="toc">
<li>
<a href="../ajax/simple.html">Ajax data source (arrays)</a>
</li>
<li>
<a href="../ajax/objects.html">Ajax data source (objects)</a>
</li>
<li>
<a href="../ajax/deep.html">Nested object data (objects)</a>
</li>
<li>
<a href="../ajax/objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="../ajax/orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="../ajax/null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="../ajax/custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="../ajax/custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="../ajax/defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./index.html">Server-side</a></h3>
<ul class="toc active">
<li>
<a href="./simple.html">Server-side processing</a>
</li>
<li>
<a href="./custom_vars.html">Custom HTTP variables</a>
</li>
<li>
<a href="./post.html">POST data</a>
</li>
<li>
<a href="./ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="./object_data.html">Object data source</a>
</li>
<li>
<a href="./row_details.html">Row details</a>
</li>
<li class="active">
<a href="./select_rows.html">Row selection</a>
</li>
<li>
<a href="./jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="./defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="./pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="../plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="../plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

View File

@ -1,26 +1,19 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<title>DataTables example - Server-side processing</title>
<link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"> <title>DataTables example - Server-side processing</title>
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css"><link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<style type="text/css" class="init"> <style type="text/css" class="init">
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <script type="text/javascript" language="javascript" class="init">
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() { $(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
"processing": true, "processing": true,
@ -29,420 +22,189 @@ $(document).ready(function() {
} ); } );
} ); } );
</script> </script>
</head> </head>
<body class="dt-example"> <body class="dt-example ">
<div class="container"> <div class="container">
<section> <section>
<h1>DataTables example <span>Server-side processing</span></h1> <h1>DataTables example <span>Server-side processing</span></h1>
<div class="info"> <div class="info">
<p>There are many ways to get your data into DataTables, and if you are working with seriously large databases, you might want to consider using the server-side <p>There are many ways to get your data into DataTables, and if you are working with seriously large databases, you might want to consider using the server-side options that DataTables provides. With server-side processing enabled, all paging, searching, ordering etc actions that DataTables performs are handed off to a server where an SQL engine (or similar) can perform these actions on the large data set (after all, that's what the database engine is designed for!). As such, each draw of the table will result in a new Ajax request being made to get the required data.</p>
options that DataTables provides. With server-side processing enabled, all paging, searching, ordering etc actions that DataTables performs are handed off to a
server where an SQL engine (or similar) can perform these actions on the large data set (after all, that's what the database engine is designed for!). As such, <p>Server-side processing is enabled by setting the <a href="//datatables.net/reference/option/serverSide"><code class="option" title="DataTables initialisation option">serverSide</code></a> option to <code>true</code> and providing an Ajax data source through the <a href="//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> option.</p>
each draw of the table will result in a new Ajax request being made to get the required data.</p>
<p>Server-side processing is enabled by setting the <a href="//datatables.net/reference/option/serverSide"><code class="option" title= <p>This example shows a very simple table, matching the other client-side processing examples, but in this instance using server-side processing.</p>
"DataTables initialisation option">serverSide</code></a> option to <code>true</code> and providing an Ajax data source through the <a href=
"//datatables.net/reference/option/ajax"><code class="option" title="DataTables initialisation option">ajax</code></a> option.</p> </div>
<p>This example shows a very simple table, matching the other client-side processing examples, but in this instance using server-side processing.</p>
</div>
<table id="example" class="display" cellspacing="0" width="100%"> <table id="example" class="display" cellspacing="0" width="100%"><thead><tr><th>First name</th><th>Last name</th><th>Position</th><th>Office</th><th>Start date</th><th>Salary</th></tr></thead><tfoot><tr><th>First name</th><th>Last name</th><th>Position</th><th>Office</th><th>Start date</th><th>Salary</th></tr></tfoot></table>
<thead>
<tr> <ul class="tabs">
<th>First name</th> <li class="active">Javascript</li>
<th>Last name</th> <li>HTML</li>
<th>Position</th> <li>CSS</li>
<th>Office</th> <li>Ajax</li>
<th>Start date</th> <li>Server-side script</li>
<th>Salary</th> </ul>
</tr>
</thead> <div class="tabs">
<tfoot> <div class="js">
<tr> <p>The Javascript shown below is used to initialise the table shown in this example:</p>
<th>First name</th> <code class="multiline language-js">$(document).ready(function() {
<th>Last name</th>
<th>Position</th>
<th>Office</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
$('#example').DataTable( { $('#example').DataTable( {
&quot;processing&quot;: true, &quot;processing&quot;: true,
&quot;serverSide&quot;: true, &quot;serverSide&quot;: true,
&quot;ajax&quot;: &quot;scripts/server_processing.php&quot; &quot;ajax&quot;: &quot;scripts/server_processing.php&quot;
} ); } );
} );</code> } );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul> <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<li> <ul><li><a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a></li><li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li></ul>
<a href="//code.jquery.com/jquery-1.12.3.js">//code.jquery.com/jquery-1.12.3.js</a> </div>
</li> <div class="table">
<li> <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
<a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a> </div>
</li> <div class="css">
</ul> <div>
</div> <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 additional CSS used is shown below:</p>
<div class="table"> <code class="multiline language-css"></code>
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p> </div>
</div>
<div class="css"> <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<div> <ul><li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li></ul>
<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 </div>
additional CSS used is shown below:</p><code class="multiline language-css"></code> <div class="ajax">
<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 loaded.</p>
</div>
<div class="php">
<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 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables documentation</a>.</p>
</div> </div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a>
</li>
</ul>
</div> </div>
<div class="ajax"> </section>
<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
loaded.</p>
</div> </div>
<div class="php">
<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 <section>
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables <div class="footer">
documentation</a>.</p> <div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group"><h3><a href="../basic_init/index.html
">Basic initialisation</a></h3><ul class="toc"><li><a href="../basic_init/zero_configuration.html
">Zero configuration</a></li><li><a href="../basic_init/filter_only.html
">Feature enable / disable</a></li><li><a href="../basic_init/table_sorting.html
">Default ordering (sorting)</a></li><li><a href="../basic_init/multi_col_sort.html
">Multi-column ordering</a></li><li><a href="../basic_init/multiple_tables.html
">Multiple tables</a></li><li><a href="../basic_init/hidden_columns.html
">Hidden columns</a></li><li><a href="../basic_init/complex_header.html
">Complex headers (rowspan and colspan)</a></li><li><a href="../basic_init/dom.html
">DOM positioning</a></li><li><a href="../basic_init/flexible_width.html
">Flexible table width</a></li><li><a href="../basic_init/state_save.html
">State saving</a></li><li><a href="../basic_init/alt_pagination.html
">Alternative pagination</a></li><li><a href="../basic_init/scroll_y.html
">Scroll - vertical</a></li><li><a href="../basic_init/scroll_y_dynamic.html
">Scroll - vertical, dynamic height</a></li><li><a href="../basic_init/scroll_x.html
">Scroll - horizontal</a></li><li><a href="../basic_init/scroll_xy.html
">Scroll - horizontal and vertical</a></li><li><a href="../basic_init/comma-decimal.html
">Language - Comma decimal place</a></li><li><a href="../basic_init/language.html
">Language options</a></li></ul></div><div class="toc-group"><h3><a href="../advanced_init/index.html
">Advanced initialisation</a></h3><ul class="toc"><li><a href="../advanced_init/events_live.html
">DOM / jQuery events</a></li><li><a href="../advanced_init/dt_events.html
">DataTables events</a></li><li><a href="../advanced_init/column_render.html
">Column rendering</a></li><li><a href="../advanced_init/length_menu.html
">Page length options</a></li><li><a href="../advanced_init/dom_multiple_elements.html
">Multiple table control elements</a></li><li><a href="../advanced_init/complex_header.html
">Complex headers with column visibility</a></li><li><a href="../advanced_init/object_dom_read.html
">Read HTML to data objects</a></li><li><a href="../advanced_init/html5-data-options.html
">HTML5 data-* attributes - table options</a></li><li><a href="../advanced_init/html5-data-attributes.html
">HTML5 data-* attributes - cell data</a></li><li><a href="../advanced_init/language_file.html
">Language file</a></li><li><a href="../advanced_init/defaults.html
">Setting defaults</a></li><li><a href="../advanced_init/row_callback.html
">Row created callback</a></li><li><a href="../advanced_init/row_grouping.html
">Row grouping</a></li><li><a href="../advanced_init/footer_callback.html
">Footer callback</a></li><li><a href="../advanced_init/dom_toolbar.html
">Custom toolbar elements</a></li><li><a href="../advanced_init/sort_direction_control.html
">Order direction sequence control</a></li></ul></div><div class="toc-group"><h3><a href="../styling/index.html
">Styling</a></h3><ul class="toc"><li><a href="../styling/display.html
">Base style</a></li><li><a href="../styling/no-classes.html
">Base style - no styling classes</a></li><li><a href="../styling/cell-border.html
">Base style - cell borders</a></li><li><a href="../styling/compact.html
">Base style - compact</a></li><li><a href="../styling/hover.html
">Base style - hover</a></li><li><a href="../styling/order-column.html
">Base style - order-column</a></li><li><a href="../styling/row-border.html
">Base style - row borders</a></li><li><a href="../styling/stripe.html
">Base style - stripe</a></li><li><a href="../styling/bootstrap.html
">Bootstrap 3</a></li><li><a href="../styling/foundation.html
">Foundation</a></li><li><a href="../styling/jqueryUI.html
">jQuery UI ThemeRoller</a></li><li><a href="../styling/bootstrap4.html
">Bootstrap 4 (Tech. preview)</a></li><li><a href="../styling/semanticui.html
">Semantic UI (Tech. preview)</a></li><li><a href="../styling/material.html
">Material Design (Tech. preview)</a></li><li><a href="../styling/uikit.html
">UIKit (Tech. preview)</a></li></ul></div><div class="toc-group"><h3><a href="../data_sources/index.html
">Data sources</a></h3><ul class="toc"><li><a href="../data_sources/dom.html
">HTML (DOM) sourced data</a></li><li><a href="../data_sources/ajax.html
">Ajax sourced data</a></li><li><a href="../data_sources/js_array.html
">Javascript sourced data</a></li><li><a href="../data_sources/server_side.html
">Server-side processing</a></li></ul></div><div class="toc-group"><h3><a href="../api/index.html
">API</a></h3><ul class="toc"><li><a href="../api/add_row.html
">Add rows</a></li><li><a href="../api/multi_filter.html
">Individual column searching (text inputs)</a></li><li><a href="../api/multi_filter_select.html
">Individual column searching (select inputs)</a></li><li><a href="../api/highlight.html
">Highlighting rows and columns</a></li><li><a href="../api/row_details.html
">Child rows (show extra / detailed information)</a></li><li><a href="../api/select_row.html
">Row selection (multiple rows)</a></li><li><a href="../api/select_single_row.html
">Row selection and deletion (single row)</a></li><li><a href="../api/form.html
">Form inputs</a></li><li><a href="../api/counter_columns.html
">Index column</a></li><li><a href="../api/show_hide.html
">Show / hide columns dynamically</a></li><li><a href="../api/api_in_init.html
">Using API in callbacks</a></li><li><a href="../api/tabs_and_scrolling.html
">Scrolling and Bootstrap tabs</a></li><li><a href="../api/regex.html
">Search API (regular expressions)</a></li></ul></div><div class="toc-group"><h3><a href="../ajax/index.html
">Ajax</a></h3><ul class="toc"><li><a href="../ajax/simple.html
">Ajax data source (arrays)</a></li><li><a href="../ajax/objects.html
">Ajax data source (objects)</a></li><li><a href="../ajax/deep.html
">Nested object data (objects)</a></li><li><a href="../ajax/objects_subarrays.html
">Nested object data (arrays)</a></li><li><a href="../ajax/orthogonal-data.html
">Orthogonal data</a></li><li><a href="../ajax/null_data_source.html
">Generated content for a column</a></li><li><a href="../ajax/custom_data_property.html
">Custom data source property</a></li><li><a href="../ajax/custom_data_flat.html
">Flat array data source</a></li><li><a href="../ajax/defer_render.html
">Deferred rendering for speed</a></li></ul></div><div class="toc-group"><h3><a href="./index.html
">Server-side</a></h3><ul class="toc active"><li class="active"><a href="./simple.html
">Server-side processing</a></li><li><a href="./custom_vars.html
">Custom HTTP variables</a></li><li><a href="./post.html
">POST data</a></li><li><a href="./ids.html
">Automatic addition of row ID attributes</a></li><li><a href="./object_data.html
">Object data source</a></li><li><a href="./row_details.html
">Row details</a></li><li><a href="./select_rows.html
">Row selection</a></li><li><a href="./jsonp.html
">JSONP data source for remote domains</a></li><li><a href="./defer_loading.html
">Deferred loading of data</a></li><li><a href="./pipeline.html
">Pipelining data to reduce Ajax calls for paging</a></li></ul></div><div class="toc-group"><h3><a href="../plug-ins/index.html
">Plug-ins</a></h3><ul class="toc"><li><a href="../plug-ins/api.html
">API plug-in methods</a></li><li><a href="../plug-ins/sorting_auto.html
">Ordering plug-ins (with type detection)</a></li><li><a href="../plug-ins/sorting_manual.html
">Ordering plug-ins (no type detection)</a></li><li><a href="../plug-ins/range_filtering.html
">Custom filtering - range search</a></li><li><a href="../plug-ins/dom_sort.html
">Live DOM ordering</a></li></ul></div>
</div>
<div class="epilogue">
<p>
Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
</p>
<p class="copyright">
DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</p>
</div>
</div> </div>
</div> </div>
</section> </section>
</div> </body>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="../basic_init/index.html">Basic initialisation</a></h3>
<ul class="toc">
<li>
<a href="../basic_init/zero_configuration.html">Zero configuration</a>
</li>
<li>
<a href="../basic_init/filter_only.html">Feature enable / disable</a>
</li>
<li>
<a href="../basic_init/table_sorting.html">Default ordering (sorting)</a>
</li>
<li>
<a href="../basic_init/multi_col_sort.html">Multi-column ordering</a>
</li>
<li>
<a href="../basic_init/multiple_tables.html">Multiple tables</a>
</li>
<li>
<a href="../basic_init/hidden_columns.html">Hidden columns</a>
</li>
<li>
<a href="../basic_init/complex_header.html">Complex headers (rowspan and colspan)</a>
</li>
<li>
<a href="../basic_init/dom.html">DOM positioning</a>
</li>
<li>
<a href="../basic_init/flexible_width.html">Flexible table width</a>
</li>
<li>
<a href="../basic_init/state_save.html">State saving</a>
</li>
<li>
<a href="../basic_init/alt_pagination.html">Alternative pagination</a>
</li>
<li>
<a href="../basic_init/scroll_y.html">Scroll - vertical</a>
</li>
<li>
<a href="../basic_init/scroll_y_dynamic.html">Scroll - vertical, dynamic height</a>
</li>
<li>
<a href="../basic_init/scroll_x.html">Scroll - horizontal</a>
</li>
<li>
<a href="../basic_init/scroll_xy.html">Scroll - horizontal and vertical</a>
</li>
<li>
<a href="../basic_init/comma-decimal.html">Language - Comma decimal place</a>
</li>
<li>
<a href="../basic_init/language.html">Language options</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../advanced_init/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="../advanced_init/events_live.html">DOM / jQuery events</a>
</li>
<li>
<a href="../advanced_init/dt_events.html">DataTables events</a>
</li>
<li>
<a href="../advanced_init/column_render.html">Column rendering</a>
</li>
<li>
<a href="../advanced_init/length_menu.html">Page length options</a>
</li>
<li>
<a href="../advanced_init/dom_multiple_elements.html">Multiple table control elements</a>
</li>
<li>
<a href="../advanced_init/complex_header.html">Complex headers with column visibility</a>
</li>
<li>
<a href="../advanced_init/object_dom_read.html">Read HTML to data objects</a>
</li>
<li>
<a href="../advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a>
</li>
<li>
<a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a>
</li>
<li>
<a href="../advanced_init/language_file.html">Language file</a>
</li>
<li>
<a href="../advanced_init/defaults.html">Setting defaults</a>
</li>
<li>
<a href="../advanced_init/row_callback.html">Row created callback</a>
</li>
<li>
<a href="../advanced_init/row_grouping.html">Row grouping</a>
</li>
<li>
<a href="../advanced_init/footer_callback.html">Footer callback</a>
</li>
<li>
<a href="../advanced_init/dom_toolbar.html">Custom toolbar elements</a>
</li>
<li>
<a href="../advanced_init/sort_direction_control.html">Order direction sequence control</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/display.html">Base style</a>
</li>
<li>
<a href="../styling/no-classes.html">Base style - no styling classes</a>
</li>
<li>
<a href="../styling/cell-border.html">Base style - cell borders</a>
</li>
<li>
<a href="../styling/compact.html">Base style - compact</a>
</li>
<li>
<a href="../styling/hover.html">Base style - hover</a>
</li>
<li>
<a href="../styling/order-column.html">Base style - order-column</a>
</li>
<li>
<a href="../styling/row-border.html">Base style - row borders</a>
</li>
<li>
<a href="../styling/stripe.html">Base style - stripe</a>
</li>
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="../styling/material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="../styling/uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../data_sources/index.html">Data sources</a></h3>
<ul class="toc">
<li>
<a href="../data_sources/dom.html">HTML (DOM) sourced data</a>
</li>
<li>
<a href="../data_sources/ajax.html">Ajax sourced data</a>
</li>
<li>
<a href="../data_sources/js_array.html">Javascript sourced data</a>
</li>
<li>
<a href="../data_sources/server_side.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="../api/add_row.html">Add rows</a>
</li>
<li>
<a href="../api/multi_filter.html">Individual column searching (text inputs)</a>
</li>
<li>
<a href="../api/multi_filter_select.html">Individual column searching (select inputs)</a>
</li>
<li>
<a href="../api/highlight.html">Highlighting rows and columns</a>
</li>
<li>
<a href="../api/row_details.html">Child rows (show extra / detailed information)</a>
</li>
<li>
<a href="../api/select_row.html">Row selection (multiple rows)</a>
</li>
<li>
<a href="../api/select_single_row.html">Row selection and deletion (single row)</a>
</li>
<li>
<a href="../api/form.html">Form inputs</a>
</li>
<li>
<a href="../api/counter_columns.html">Index column</a>
</li>
<li>
<a href="../api/show_hide.html">Show / hide columns dynamically</a>
</li>
<li>
<a href="../api/api_in_init.html">Using API in callbacks</a>
</li>
<li>
<a href="../api/tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a>
</li>
<li>
<a href="../api/regex.html">Search API (regular expressions)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../ajax/index.html">Ajax</a></h3>
<ul class="toc">
<li>
<a href="../ajax/simple.html">Ajax data source (arrays)</a>
</li>
<li>
<a href="../ajax/objects.html">Ajax data source (objects)</a>
</li>
<li>
<a href="../ajax/deep.html">Nested object data (objects)</a>
</li>
<li>
<a href="../ajax/objects_subarrays.html">Nested object data (arrays)</a>
</li>
<li>
<a href="../ajax/orthogonal-data.html">Orthogonal data</a>
</li>
<li>
<a href="../ajax/null_data_source.html">Generated content for a column</a>
</li>
<li>
<a href="../ajax/custom_data_property.html">Custom data source property</a>
</li>
<li>
<a href="../ajax/custom_data_flat.html">Flat array data source</a>
</li>
<li>
<a href="../ajax/defer_render.html">Deferred rendering for speed</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./index.html">Server-side</a></h3>
<ul class="toc active">
<li class="active">
<a href="./simple.html">Server-side processing</a>
</li>
<li>
<a href="./custom_vars.html">Custom HTTP variables</a>
</li>
<li>
<a href="./post.html">POST data</a>
</li>
<li>
<a href="./ids.html">Automatic addition of row ID attributes</a>
</li>
<li>
<a href="./object_data.html">Object data source</a>
</li>
<li>
<a href="./row_details.html">Row details</a>
</li>
<li>
<a href="./select_rows.html">Row selection</a>
</li>
<li>
<a href="./jsonp.html">JSONP data source for remote domains</a>
</li>
<li>
<a href="./defer_loading.html">Deferred loading of data</a>
</li>
<li>
<a href="./pipeline.html">Pipelining data to reduce Ajax calls for paging</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/api.html">API plug-in methods</a>
</li>
<li>
<a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a>
</li>
<li>
<a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a>
</li>
<li>
<a href="../plug-ins/range_filtering.html">Custom filtering - range search</a>
</li>
<li>
<a href="../plug-ins/dom_sort.html">Live DOM ordering</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> </html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,97 +1,64 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0" />
<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../resources/demo.css"> <link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css"><link rel="stylesheet" type="text/css" href="../resources/demo.css">
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"> <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script><script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script><script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
</script> <title>DataTables examples - Styling</title>
<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"> </head>
</script> <body class="dt-example">
<script type="text/javascript" language="javascript" src="../resources/demo.js"> <div class="container">
</script> <section>
<title>DataTables examples - Styling</title> <h1>DataTables example <span>Styling</span></h1>
</head> <div class="info">
<body class="dt-example"> <p>When using DataTables, you want your tables to fit in with your site / app to make the end user experience as seamless as possible. For this reason, DataTables provides an easy to customise core stylesheet, which has a number of features that you can enable or disable as you required. Additionally there are a number of integration packages which can be used to fit DataTables into a site which uses some of the popular CSS libraries such as Twitter Bootstrap and Foundation. Or of course you can craft your own CSS to fit it into your site perfectly!</p>
<div class="container">
<p>This section includes examples of how DataTables can be styled using these methods.</p>
</div>
</section>
</div>
<section> <section>
<h1>DataTables example <span>Styling</span></h1> <div class="footer">
<div class="info"> <div class="gradient"></div>
<p>When using DataTables, you want your tables to fit in with your site / app to make the end user experience as seamless as possible. For this reason, DataTables <div class="liner">
provides an easy to customise core stylesheet, which has a number of features that you can enable or disable as you required. Additionally there are a number of <div class="toc">
integration packages which can be used to fit DataTables into a site which uses some of the popular CSS libraries such as Twitter Bootstrap and Foundation. Or of <div class="toc-group"><h3><a href="./index.html
course you can craft your own CSS to fit it into your site perfectly!</p> ">Styling</a></h3><ul class="toc"><li><a href="./display.html
<p>This section includes examples of how DataTables can be styled using these methods.</p> ">Base style</a></li><li><a href="./no-classes.html
</div> ">Base style - no styling classes</a></li><li><a href="./cell-border.html
</section> ">Base style - cell borders</a></li><li><a href="./compact.html
</div> ">Base style - compact</a></li><li><a href="./hover.html
<section> ">Base style - hover</a></li><li><a href="./order-column.html
<div class="footer"> ">Base style - order-column</a></li><li><a href="./row-border.html
<div class="gradient"></div> ">Base style - row borders</a></li><li><a href="./stripe.html
<div class="liner"> ">Base style - stripe</a></li><li><a href="./bootstrap.html
<div class="toc"> ">Bootstrap 3</a></li><li><a href="./foundation.html
<div class="toc-group"> ">Foundation</a></li><li><a href="./jqueryUI.html
<h3><a href="./index.html">Styling</a></h3> ">jQuery UI ThemeRoller</a></li><li><a href="./bootstrap4.html
<ul class="toc"> ">Bootstrap 4 (Tech. preview)</a></li><li><a href="./semanticui.html
<li> ">Semantic UI (Tech. preview)</a></li><li><a href="./material.html
<a href="./display.html">Base style</a> ">Material Design (Tech. preview)</a></li><li><a href="./uikit.html
</li> ">UIKit (Tech. preview)</a></li></ul></div>
<li> </div>
<a href="./no-classes.html">Base style - no styling classes</a>
</li> <div class="epilogue">
<li> <p>
<a href="./cell-border.html">Base style - cell borders</a> Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
</li> Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.
<li> </p>
<a href="./compact.html">Base style - compact</a>
</li> <p class="copyright">
<li> DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &copy; 2007-2016<br>
<a href="./hover.html">Base style - hover</a> DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.
</li> </p>
<li>
<a href="./order-column.html">Base style - order-column</a>
</li>
<li>
<a href="./row-border.html">Base style - row borders</a>
</li>
<li>
<a href="./stripe.html">Base style - stripe</a>
</li>
<li>
<a href="./bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="./foundation.html">Foundation</a>
</li>
<li>
<a href="./jqueryUI.html">jQuery UI ThemeRoller</a>
</li>
<li>
<a href="./bootstrap4.html">Bootstrap 4 (Tech. preview)</a>
</li>
<li>
<a href="./semanticui.html">Semantic UI (Tech. preview)</a>
</li>
<li>
<a href="./material.html">Material Design (Tech. preview)</a>
</li>
<li>
<a href="./uikit.html">UIKit (Tech. preview)</a>
</li>
</ul>
</div> </div>
</div> </div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div> </div>
</div> </section>
</section> </body>
</body>
</html> </html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More