mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2025-06-15 04:26:05 +00:00
Initial commit
This commit is contained in:
329
app/static/global/plugins/datatables/examples/api/add_row.html
Normal file
329
app/static/global/plugins/datatables/examples/api/add_row.html
Normal file
@ -0,0 +1,329 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<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">
|
||||
|
||||
<title>DataTables example - Add rows</title>
|
||||
<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>
|
||||
<script type="text/javascript" language="javascript" src="../../media/js/jquery.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 type="text/javascript" language="javascript" class="init">
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
var t = $('#example').DataTable();
|
||||
var counter = 1;
|
||||
|
||||
$('#addRow').on( 'click', function () {
|
||||
t.row.add( [
|
||||
counter +'.1',
|
||||
counter +'.2',
|
||||
counter +'.3',
|
||||
counter +'.4',
|
||||
counter +'.5'
|
||||
] ).draw();
|
||||
|
||||
counter++;
|
||||
} );
|
||||
|
||||
// Automatically add a first row of data
|
||||
$('#addRow').click();
|
||||
} );
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body class="dt-example">
|
||||
<div class="container">
|
||||
<section>
|
||||
<h1>DataTables example <span>Add rows</span></h1>
|
||||
|
||||
<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=
|
||||
"DataTables API method">row.add()<span>DT</span></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()<span>DT</span></code></a> method (note the plural).</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=
|
||||
"DataTables API method">draw()<span>DT</span></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><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>
|
||||
</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 brush: js;">$(document).ready(function() {
|
||||
var t = $('#example').DataTable();
|
||||
var counter = 1;
|
||||
|
||||
$('#addRow').on( 'click', function () {
|
||||
t.row.add( [
|
||||
counter +'.1',
|
||||
counter +'.2',
|
||||
counter +'.3',
|
||||
counter +'.4',
|
||||
counter +'.5'
|
||||
] ).draw();
|
||||
|
||||
counter++;
|
||||
} );
|
||||
|
||||
// Automatically add a first row of data
|
||||
$('#addRow').click();
|
||||
} );</code>
|
||||
|
||||
<p>In addition to the above code, the following Javascript library files are loaded for use in this
|
||||
example:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="../../media/js/jquery.js">../../media/js/jquery.js</a></li>
|
||||
<li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="table">
|
||||
<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 brush: js;"></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>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<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_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/scroll_y_theme.html">Scroll - vertical with jQuery UI
|
||||
ThemeRoller</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 (rowspan /
|
||||
colspan)</a></li>
|
||||
<li><a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes</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</a></li>
|
||||
<li><a href="../styling/foundation.html">Foundation</a></li>
|
||||
<li><a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</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 jQuery UI 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/extras">extras</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-2014<br>
|
||||
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,779 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<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">
|
||||
|
||||
<title>DataTables example - Using API in callbacks</title>
|
||||
<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>
|
||||
<script type="text/javascript" language="javascript" src="../../media/js/jquery.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 type="text/javascript" language="javascript" class="init">
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#example').dataTable( {
|
||||
"initComplete": function () {
|
||||
var api = this.api();
|
||||
api.$('td').click( function () {
|
||||
api.search( this.innerHTML ).draw();
|
||||
} );
|
||||
}
|
||||
} );
|
||||
} );
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body class="dt-example">
|
||||
<div class="container">
|
||||
<section>
|
||||
<h1>DataTables example <span>Using API in callbacks</span></h1>
|
||||
|
||||
<div class="info">
|
||||
<p>There are times when you may wish to call API functions inside the DataTables callback functions
|
||||
(for example <a href="//datatables.net/reference/option/initComplete"><code class="option" title=
|
||||
"DataTables initialisation option">initComplete<span>DT</span></code></a>, <a href=
|
||||
"//datatables.net/reference/option/rowCallback"><code class="option" title=
|
||||
"DataTables initialisation option">rowCallback<span>DT</span></code></a> etc). The complicating issue
|
||||
with this is that the object hasn't fully initialised, so you can't assign the result to a variable and
|
||||
then use that variable in the callback. However, all of DataTables' callback functions are executed in
|
||||
the scope of the DataTable instance, so you can use the Javascript special variable <code>this</code>
|
||||
to access the API (<code>this.api()</code> will give an API instance) as <code>this</code> is the
|
||||
<code class="tag" title="HTML tag">table</code> node.</p>
|
||||
|
||||
<p>In this example you will be able to see that the <a href=
|
||||
"//datatables.net/reference/api/%24()"><code class="api" title=
|
||||
"DataTables API method">$()<span>DT</span></code></a> method is used to get all cell nodes in the
|
||||
table's body and then act on them (in this case adding a click event). The action here is to apply a
|
||||
filter to the table with the value of what is in each cell.</p>
|
||||
|
||||
<p>It is also worth noting that this same effect could be achieved by attaching a delegated click event
|
||||
after the table has been initialised - but the example shows the use of the API inside the
|
||||
callbacks!</p>
|
||||
</div>
|
||||
|
||||
<table id="example" class="display" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Position</th>
|
||||
<th>Office</th>
|
||||
<th>Age</th>
|
||||
<th>Start date</th>
|
||||
<th>Salary</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Position</th>
|
||||
<th>Office</th>
|
||||
<th>Age</th>
|
||||
<th>Start date</th>
|
||||
<th>Salary</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Tiger Nixon</td>
|
||||
<td>System Architect</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>61</td>
|
||||
<td>2011/04/25</td>
|
||||
<td>$320,800</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Garrett Winters</td>
|
||||
<td>Accountant</td>
|
||||
<td>Tokyo</td>
|
||||
<td>63</td>
|
||||
<td>2011/07/25</td>
|
||||
<td>$170,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Ashton Cox</td>
|
||||
<td>Junior Technical Author</td>
|
||||
<td>San Francisco</td>
|
||||
<td>66</td>
|
||||
<td>2009/01/12</td>
|
||||
<td>$86,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cedric Kelly</td>
|
||||
<td>Senior Javascript Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>22</td>
|
||||
<td>2012/03/29</td>
|
||||
<td>$433,060</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Airi Satou</td>
|
||||
<td>Accountant</td>
|
||||
<td>Tokyo</td>
|
||||
<td>33</td>
|
||||
<td>2008/11/28</td>
|
||||
<td>$162,700</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Brielle Williamson</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>New York</td>
|
||||
<td>61</td>
|
||||
<td>2012/12/02</td>
|
||||
<td>$372,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Herrod Chandler</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>San Francisco</td>
|
||||
<td>59</td>
|
||||
<td>2012/08/06</td>
|
||||
<td>$137,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Rhona Davidson</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>Tokyo</td>
|
||||
<td>55</td>
|
||||
<td>2010/10/14</td>
|
||||
<td>$327,900</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Colleen Hurst</td>
|
||||
<td>Javascript Developer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>39</td>
|
||||
<td>2009/09/15</td>
|
||||
<td>$205,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sonya Frost</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>23</td>
|
||||
<td>2008/12/13</td>
|
||||
<td>$103,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jena Gaines</td>
|
||||
<td>Office Manager</td>
|
||||
<td>London</td>
|
||||
<td>30</td>
|
||||
<td>2008/12/19</td>
|
||||
<td>$90,560</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Quinn Flynn</td>
|
||||
<td>Support Lead</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>22</td>
|
||||
<td>2013/03/03</td>
|
||||
<td>$342,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Charde Marshall</td>
|
||||
<td>Regional Director</td>
|
||||
<td>San Francisco</td>
|
||||
<td>36</td>
|
||||
<td>2008/10/16</td>
|
||||
<td>$470,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Haley Kennedy</td>
|
||||
<td>Senior Marketing Designer</td>
|
||||
<td>London</td>
|
||||
<td>43</td>
|
||||
<td>2012/12/18</td>
|
||||
<td>$313,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Tatyana Fitzpatrick</td>
|
||||
<td>Regional Director</td>
|
||||
<td>London</td>
|
||||
<td>19</td>
|
||||
<td>2010/03/17</td>
|
||||
<td>$385,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Michael Silva</td>
|
||||
<td>Marketing Designer</td>
|
||||
<td>London</td>
|
||||
<td>66</td>
|
||||
<td>2012/11/27</td>
|
||||
<td>$198,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Paul Byrd</td>
|
||||
<td>Chief Financial Officer (CFO)</td>
|
||||
<td>New York</td>
|
||||
<td>64</td>
|
||||
<td>2010/06/09</td>
|
||||
<td>$725,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gloria Little</td>
|
||||
<td>Systems Administrator</td>
|
||||
<td>New York</td>
|
||||
<td>59</td>
|
||||
<td>2009/04/10</td>
|
||||
<td>$237,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bradley Greer</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>London</td>
|
||||
<td>41</td>
|
||||
<td>2012/10/13</td>
|
||||
<td>$132,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Dai Rios</td>
|
||||
<td>Personnel Lead</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>35</td>
|
||||
<td>2012/09/26</td>
|
||||
<td>$217,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jenette Caldwell</td>
|
||||
<td>Development Lead</td>
|
||||
<td>New York</td>
|
||||
<td>30</td>
|
||||
<td>2011/09/03</td>
|
||||
<td>$345,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Yuri Berry</td>
|
||||
<td>Chief Marketing Officer (CMO)</td>
|
||||
<td>New York</td>
|
||||
<td>40</td>
|
||||
<td>2009/06/25</td>
|
||||
<td>$675,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Caesar Vance</td>
|
||||
<td>Pre-Sales Support</td>
|
||||
<td>New York</td>
|
||||
<td>21</td>
|
||||
<td>2011/12/12</td>
|
||||
<td>$106,450</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Doris Wilder</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>Sidney</td>
|
||||
<td>23</td>
|
||||
<td>2010/09/20</td>
|
||||
<td>$85,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Angelica Ramos</td>
|
||||
<td>Chief Executive Officer (CEO)</td>
|
||||
<td>London</td>
|
||||
<td>47</td>
|
||||
<td>2009/10/09</td>
|
||||
<td>$1,200,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gavin Joyce</td>
|
||||
<td>Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>42</td>
|
||||
<td>2010/12/22</td>
|
||||
<td>$92,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jennifer Chang</td>
|
||||
<td>Regional Director</td>
|
||||
<td>Singapore</td>
|
||||
<td>28</td>
|
||||
<td>2010/11/14</td>
|
||||
<td>$357,650</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Brenden Wagner</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>28</td>
|
||||
<td>2011/06/07</td>
|
||||
<td>$206,850</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fiona Green</td>
|
||||
<td>Chief Operating Officer (COO)</td>
|
||||
<td>San Francisco</td>
|
||||
<td>48</td>
|
||||
<td>2010/03/11</td>
|
||||
<td>$850,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Shou Itou</td>
|
||||
<td>Regional Marketing</td>
|
||||
<td>Tokyo</td>
|
||||
<td>20</td>
|
||||
<td>2011/08/14</td>
|
||||
<td>$163,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Michelle House</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>Sidney</td>
|
||||
<td>37</td>
|
||||
<td>2011/06/02</td>
|
||||
<td>$95,400</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Suki Burks</td>
|
||||
<td>Developer</td>
|
||||
<td>London</td>
|
||||
<td>53</td>
|
||||
<td>2009/10/22</td>
|
||||
<td>$114,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Prescott Bartlett</td>
|
||||
<td>Technical Author</td>
|
||||
<td>London</td>
|
||||
<td>27</td>
|
||||
<td>2011/05/07</td>
|
||||
<td>$145,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gavin Cortez</td>
|
||||
<td>Team Leader</td>
|
||||
<td>San Francisco</td>
|
||||
<td>22</td>
|
||||
<td>2008/10/26</td>
|
||||
<td>$235,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Martena Mccray</td>
|
||||
<td>Post-Sales support</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>46</td>
|
||||
<td>2011/03/09</td>
|
||||
<td>$324,050</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Unity Butler</td>
|
||||
<td>Marketing Designer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>47</td>
|
||||
<td>2009/12/09</td>
|
||||
<td>$85,675</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Howard Hatfield</td>
|
||||
<td>Office Manager</td>
|
||||
<td>San Francisco</td>
|
||||
<td>51</td>
|
||||
<td>2008/12/16</td>
|
||||
<td>$164,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hope Fuentes</td>
|
||||
<td>Secretary</td>
|
||||
<td>San Francisco</td>
|
||||
<td>41</td>
|
||||
<td>2010/02/12</td>
|
||||
<td>$109,850</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Vivian Harrell</td>
|
||||
<td>Financial Controller</td>
|
||||
<td>San Francisco</td>
|
||||
<td>62</td>
|
||||
<td>2009/02/14</td>
|
||||
<td>$452,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Timothy Mooney</td>
|
||||
<td>Office Manager</td>
|
||||
<td>London</td>
|
||||
<td>37</td>
|
||||
<td>2008/12/11</td>
|
||||
<td>$136,200</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jackson Bradshaw</td>
|
||||
<td>Director</td>
|
||||
<td>New York</td>
|
||||
<td>65</td>
|
||||
<td>2008/09/26</td>
|
||||
<td>$645,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Olivia Liang</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>Singapore</td>
|
||||
<td>64</td>
|
||||
<td>2011/02/03</td>
|
||||
<td>$234,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruno Nash</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>London</td>
|
||||
<td>38</td>
|
||||
<td>2011/05/03</td>
|
||||
<td>$163,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sakura Yamamoto</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>Tokyo</td>
|
||||
<td>37</td>
|
||||
<td>2009/08/19</td>
|
||||
<td>$139,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Thor Walton</td>
|
||||
<td>Developer</td>
|
||||
<td>New York</td>
|
||||
<td>61</td>
|
||||
<td>2013/08/11</td>
|
||||
<td>$98,540</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Finn Camacho</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>47</td>
|
||||
<td>2009/07/07</td>
|
||||
<td>$87,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Serge Baldwin</td>
|
||||
<td>Data Coordinator</td>
|
||||
<td>Singapore</td>
|
||||
<td>64</td>
|
||||
<td>2012/04/09</td>
|
||||
<td>$138,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Zenaida Frank</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>New York</td>
|
||||
<td>63</td>
|
||||
<td>2010/01/04</td>
|
||||
<td>$125,250</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Zorita Serrano</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>56</td>
|
||||
<td>2012/06/01</td>
|
||||
<td>$115,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jennifer Acosta</td>
|
||||
<td>Junior Javascript Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>43</td>
|
||||
<td>2013/02/01</td>
|
||||
<td>$75,650</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cara Stevens</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>New York</td>
|
||||
<td>46</td>
|
||||
<td>2011/12/06</td>
|
||||
<td>$145,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hermione Butler</td>
|
||||
<td>Regional Director</td>
|
||||
<td>London</td>
|
||||
<td>47</td>
|
||||
<td>2011/03/21</td>
|
||||
<td>$356,250</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Lael Greer</td>
|
||||
<td>Systems Administrator</td>
|
||||
<td>London</td>
|
||||
<td>21</td>
|
||||
<td>2009/02/27</td>
|
||||
<td>$103,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jonas Alexander</td>
|
||||
<td>Developer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>30</td>
|
||||
<td>2010/07/14</td>
|
||||
<td>$86,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Shad Decker</td>
|
||||
<td>Regional Director</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>51</td>
|
||||
<td>2008/11/13</td>
|
||||
<td>$183,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Michael Bruce</td>
|
||||
<td>Javascript Developer</td>
|
||||
<td>Singapore</td>
|
||||
<td>29</td>
|
||||
<td>2011/06/27</td>
|
||||
<td>$183,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Donna Snider</td>
|
||||
<td>Customer Support</td>
|
||||
<td>New York</td>
|
||||
<td>27</td>
|
||||
<td>2011/01/25</td>
|
||||
<td>$112,000</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 brush: js;">$(document).ready(function() {
|
||||
$('#example').dataTable( {
|
||||
"initComplete": function () {
|
||||
var api = this.api();
|
||||
api.$('td').click( function () {
|
||||
api.search( this.innerHTML ).draw();
|
||||
} );
|
||||
}
|
||||
} );
|
||||
} );</code>
|
||||
|
||||
<p>In addition to the above code, the following Javascript library files are loaded for use in this
|
||||
example:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="../../media/js/jquery.js">../../media/js/jquery.js</a></li>
|
||||
<li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="table">
|
||||
<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 brush: js;"></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>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<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_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/scroll_y_theme.html">Scroll - vertical with jQuery UI
|
||||
ThemeRoller</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 (rowspan /
|
||||
colspan)</a></li>
|
||||
<li><a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes</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</a></li>
|
||||
<li><a href="../styling/foundation.html">Foundation</a></li>
|
||||
<li><a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</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 class="active"><a href="./api_in_init.html">Using API in callbacks</a></li>
|
||||
<li><a href="./tabs_and_scrolling.html">Scrolling and jQuery UI 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/extras">extras</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-2014<br>
|
||||
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,788 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<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">
|
||||
|
||||
<title>DataTables example - Index column</title>
|
||||
<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>
|
||||
<script type="text/javascript" language="javascript" src="../../media/js/jquery.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 type="text/javascript" language="javascript" class="init">
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
var t = $('#example').DataTable( {
|
||||
"columnDefs": [ {
|
||||
"searchable": false,
|
||||
"orderable": false,
|
||||
"targets": 0
|
||||
} ],
|
||||
"order": [[ 1, 'asc' ]]
|
||||
} );
|
||||
|
||||
t.on( 'order.dt search.dt', function () {
|
||||
t.column(0, {search:'applied', order:'applied'}).nodes().each( function (cell, i) {
|
||||
cell.innerHTML = i+1;
|
||||
} );
|
||||
} ).draw();
|
||||
} );
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body class="dt-example">
|
||||
<div class="container">
|
||||
<section>
|
||||
<h1>DataTables example <span>Index column</span></h1>
|
||||
|
||||
<div class="info">
|
||||
<p>A fairly common requirement for highly interactive tables which are displayed on the web is to have
|
||||
a column which with a 'counter' for the row number. This column should not be sortable, and will change
|
||||
dynamically as the ordering and searching applied to the table is altered by the end user.</p>
|
||||
|
||||
<p>This example shows how this can be achieved with DataTables, where the first column is the counter
|
||||
column, and is updated when ordering or searching occurs. This is done by listening for the <a href=
|
||||
"//datatables.net/reference/event/order"><code class="event" title=
|
||||
"DataTables event">order<span>DT</span></code></a> and <a href=
|
||||
"//datatables.net/reference/event/search"><code class="event" title=
|
||||
"DataTables event">search<span>DT</span></code></a> events emitted by the table. When these events are
|
||||
detected the <a href="//datatables.net/reference/api/column().nodes()"><code class="api" title=
|
||||
"DataTables API method">column().nodes()<span>DT</span></code></a> method is used to get the TD/TH
|
||||
nodes for the target column and the <code>each()</code> helper function used to iterate over each,
|
||||
which have their contents updated as needed. Note that the <code>filter</code> and <code>order</code>
|
||||
options are using in the <a href="//datatables.net/reference/api/column()"><code class="api" title=
|
||||
"DataTables API method">column()<span>DT</span></code></a> method to get the nodes in the current order
|
||||
and with the currently applied filter.</p>
|
||||
</div>
|
||||
|
||||
<table id="example" class="display" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Name</th>
|
||||
<th>Position</th>
|
||||
<th>Office</th>
|
||||
<th>Age</th>
|
||||
<th>Salary</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Name</th>
|
||||
<th>Position</th>
|
||||
<th>Office</th>
|
||||
<th>Age</th>
|
||||
<th>Salary</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Tiger Nixon</td>
|
||||
<td>System Architect</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>61</td>
|
||||
<td>$320,800</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Garrett Winters</td>
|
||||
<td>Accountant</td>
|
||||
<td>Tokyo</td>
|
||||
<td>63</td>
|
||||
<td>$170,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Ashton Cox</td>
|
||||
<td>Junior Technical Author</td>
|
||||
<td>San Francisco</td>
|
||||
<td>66</td>
|
||||
<td>$86,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Cedric Kelly</td>
|
||||
<td>Senior Javascript Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>22</td>
|
||||
<td>$433,060</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Airi Satou</td>
|
||||
<td>Accountant</td>
|
||||
<td>Tokyo</td>
|
||||
<td>33</td>
|
||||
<td>$162,700</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Brielle Williamson</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>New York</td>
|
||||
<td>61</td>
|
||||
<td>$372,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Herrod Chandler</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>San Francisco</td>
|
||||
<td>59</td>
|
||||
<td>$137,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Rhona Davidson</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>Tokyo</td>
|
||||
<td>55</td>
|
||||
<td>$327,900</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Colleen Hurst</td>
|
||||
<td>Javascript Developer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>39</td>
|
||||
<td>$205,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Sonya Frost</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>23</td>
|
||||
<td>$103,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Jena Gaines</td>
|
||||
<td>Office Manager</td>
|
||||
<td>London</td>
|
||||
<td>30</td>
|
||||
<td>$90,560</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Quinn Flynn</td>
|
||||
<td>Support Lead</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>22</td>
|
||||
<td>$342,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Charde Marshall</td>
|
||||
<td>Regional Director</td>
|
||||
<td>San Francisco</td>
|
||||
<td>36</td>
|
||||
<td>$470,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Haley Kennedy</td>
|
||||
<td>Senior Marketing Designer</td>
|
||||
<td>London</td>
|
||||
<td>43</td>
|
||||
<td>$313,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Tatyana Fitzpatrick</td>
|
||||
<td>Regional Director</td>
|
||||
<td>London</td>
|
||||
<td>19</td>
|
||||
<td>$385,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Michael Silva</td>
|
||||
<td>Marketing Designer</td>
|
||||
<td>London</td>
|
||||
<td>66</td>
|
||||
<td>$198,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Paul Byrd</td>
|
||||
<td>Chief Financial Officer (CFO)</td>
|
||||
<td>New York</td>
|
||||
<td>64</td>
|
||||
<td>$725,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Gloria Little</td>
|
||||
<td>Systems Administrator</td>
|
||||
<td>New York</td>
|
||||
<td>59</td>
|
||||
<td>$237,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Bradley Greer</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>London</td>
|
||||
<td>41</td>
|
||||
<td>$132,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Dai Rios</td>
|
||||
<td>Personnel Lead</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>35</td>
|
||||
<td>$217,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Jenette Caldwell</td>
|
||||
<td>Development Lead</td>
|
||||
<td>New York</td>
|
||||
<td>30</td>
|
||||
<td>$345,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Yuri Berry</td>
|
||||
<td>Chief Marketing Officer (CMO)</td>
|
||||
<td>New York</td>
|
||||
<td>40</td>
|
||||
<td>$675,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Caesar Vance</td>
|
||||
<td>Pre-Sales Support</td>
|
||||
<td>New York</td>
|
||||
<td>21</td>
|
||||
<td>$106,450</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Doris Wilder</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>Sidney</td>
|
||||
<td>23</td>
|
||||
<td>$85,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Angelica Ramos</td>
|
||||
<td>Chief Executive Officer (CEO)</td>
|
||||
<td>London</td>
|
||||
<td>47</td>
|
||||
<td>$1,200,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Gavin Joyce</td>
|
||||
<td>Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>42</td>
|
||||
<td>$92,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Jennifer Chang</td>
|
||||
<td>Regional Director</td>
|
||||
<td>Singapore</td>
|
||||
<td>28</td>
|
||||
<td>$357,650</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Brenden Wagner</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>28</td>
|
||||
<td>$206,850</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Fiona Green</td>
|
||||
<td>Chief Operating Officer (COO)</td>
|
||||
<td>San Francisco</td>
|
||||
<td>48</td>
|
||||
<td>$850,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Shou Itou</td>
|
||||
<td>Regional Marketing</td>
|
||||
<td>Tokyo</td>
|
||||
<td>20</td>
|
||||
<td>$163,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Michelle House</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>Sidney</td>
|
||||
<td>37</td>
|
||||
<td>$95,400</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Suki Burks</td>
|
||||
<td>Developer</td>
|
||||
<td>London</td>
|
||||
<td>53</td>
|
||||
<td>$114,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Prescott Bartlett</td>
|
||||
<td>Technical Author</td>
|
||||
<td>London</td>
|
||||
<td>27</td>
|
||||
<td>$145,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Gavin Cortez</td>
|
||||
<td>Team Leader</td>
|
||||
<td>San Francisco</td>
|
||||
<td>22</td>
|
||||
<td>$235,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Martena Mccray</td>
|
||||
<td>Post-Sales support</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>46</td>
|
||||
<td>$324,050</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Unity Butler</td>
|
||||
<td>Marketing Designer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>47</td>
|
||||
<td>$85,675</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Howard Hatfield</td>
|
||||
<td>Office Manager</td>
|
||||
<td>San Francisco</td>
|
||||
<td>51</td>
|
||||
<td>$164,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Hope Fuentes</td>
|
||||
<td>Secretary</td>
|
||||
<td>San Francisco</td>
|
||||
<td>41</td>
|
||||
<td>$109,850</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Vivian Harrell</td>
|
||||
<td>Financial Controller</td>
|
||||
<td>San Francisco</td>
|
||||
<td>62</td>
|
||||
<td>$452,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Timothy Mooney</td>
|
||||
<td>Office Manager</td>
|
||||
<td>London</td>
|
||||
<td>37</td>
|
||||
<td>$136,200</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Jackson Bradshaw</td>
|
||||
<td>Director</td>
|
||||
<td>New York</td>
|
||||
<td>65</td>
|
||||
<td>$645,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Olivia Liang</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>Singapore</td>
|
||||
<td>64</td>
|
||||
<td>$234,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Bruno Nash</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>London</td>
|
||||
<td>38</td>
|
||||
<td>$163,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Sakura Yamamoto</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>Tokyo</td>
|
||||
<td>37</td>
|
||||
<td>$139,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Thor Walton</td>
|
||||
<td>Developer</td>
|
||||
<td>New York</td>
|
||||
<td>61</td>
|
||||
<td>$98,540</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Finn Camacho</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>47</td>
|
||||
<td>$87,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Serge Baldwin</td>
|
||||
<td>Data Coordinator</td>
|
||||
<td>Singapore</td>
|
||||
<td>64</td>
|
||||
<td>$138,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Zenaida Frank</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>New York</td>
|
||||
<td>63</td>
|
||||
<td>$125,250</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Zorita Serrano</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>56</td>
|
||||
<td>$115,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Jennifer Acosta</td>
|
||||
<td>Junior Javascript Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>43</td>
|
||||
<td>$75,650</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Cara Stevens</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>New York</td>
|
||||
<td>46</td>
|
||||
<td>$145,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Hermione Butler</td>
|
||||
<td>Regional Director</td>
|
||||
<td>London</td>
|
||||
<td>47</td>
|
||||
<td>$356,250</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Lael Greer</td>
|
||||
<td>Systems Administrator</td>
|
||||
<td>London</td>
|
||||
<td>21</td>
|
||||
<td>$103,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Jonas Alexander</td>
|
||||
<td>Developer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>30</td>
|
||||
<td>$86,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Shad Decker</td>
|
||||
<td>Regional Director</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>51</td>
|
||||
<td>$183,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Michael Bruce</td>
|
||||
<td>Javascript Developer</td>
|
||||
<td>Singapore</td>
|
||||
<td>29</td>
|
||||
<td>$183,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Donna Snider</td>
|
||||
<td>Customer Support</td>
|
||||
<td>New York</td>
|
||||
<td>27</td>
|
||||
<td>$112,000</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 brush: js;">$(document).ready(function() {
|
||||
var t = $('#example').DataTable( {
|
||||
"columnDefs": [ {
|
||||
"searchable": false,
|
||||
"orderable": false,
|
||||
"targets": 0
|
||||
} ],
|
||||
"order": [[ 1, 'asc' ]]
|
||||
} );
|
||||
|
||||
t.on( 'order.dt search.dt', function () {
|
||||
t.column(0, {search:'applied', order:'applied'}).nodes().each( function (cell, i) {
|
||||
cell.innerHTML = i+1;
|
||||
} );
|
||||
} ).draw();
|
||||
} );</code>
|
||||
|
||||
<p>In addition to the above code, the following Javascript library files are loaded for use in this
|
||||
example:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="../../media/js/jquery.js">../../media/js/jquery.js</a></li>
|
||||
<li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="table">
|
||||
<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 brush: js;"></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>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<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_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/scroll_y_theme.html">Scroll - vertical with jQuery UI
|
||||
ThemeRoller</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 (rowspan /
|
||||
colspan)</a></li>
|
||||
<li><a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes</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</a></li>
|
||||
<li><a href="../styling/foundation.html">Foundation</a></li>
|
||||
<li><a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</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 class="active"><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 jQuery UI 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/extras">extras</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-2014<br>
|
||||
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
1841
app/static/global/plugins/datatables/examples/api/form.html
Normal file
1841
app/static/global/plugins/datatables/examples/api/form.html
Normal file
File diff suppressed because it is too large
Load Diff
794
app/static/global/plugins/datatables/examples/api/highlight.html
Normal file
794
app/static/global/plugins/datatables/examples/api/highlight.html
Normal file
@ -0,0 +1,794 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<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">
|
||||
|
||||
<title>DataTables example - Highlighting rows and columns</title>
|
||||
<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">
|
||||
|
||||
|
||||
td.highlight {
|
||||
background-color: whitesmoke !important;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
<script type="text/javascript" language="javascript" src="../../media/js/jquery.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 type="text/javascript" language="javascript" class="init">
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
var lastIdx = null;
|
||||
var table = $('#example').DataTable();
|
||||
|
||||
$('#example tbody')
|
||||
.on( 'mouseover', 'td', function () {
|
||||
var colIdx = table.cell(this).index().column;
|
||||
|
||||
if ( colIdx !== lastIdx ) {
|
||||
$( table.cells().nodes() ).removeClass( 'highlight' );
|
||||
$( table.column( colIdx ).nodes() ).addClass( 'highlight' );
|
||||
}
|
||||
} )
|
||||
.on( 'mouseleave', function () {
|
||||
$( table.cells().nodes() ).removeClass( 'highlight' );
|
||||
} );
|
||||
} );
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body class="dt-example">
|
||||
<div class="container">
|
||||
<section>
|
||||
<h1>DataTables example <span>Highlighting rows and columns</span></h1>
|
||||
|
||||
<div class="info">
|
||||
<p>Highlighting rows and columns have be quite useful for drawing attention to where the user's cursor
|
||||
is in a table, particularly if you have a lot of narrow columns. Of course the highlighting of a row is
|
||||
easy enough using CSS, but for column highlighting, you need to use a little bit of Javascript.</p>
|
||||
|
||||
<p>This example shows that in action on DataTable by making use of the <a href=
|
||||
"//datatables.net/reference/api/cell().index()"><code class="api" title=
|
||||
"DataTables API method">cell().index()<span>DT</span></code></a> method to get the index of the column
|
||||
that is to be operated on, and then the <a href=
|
||||
"//datatables.net/reference/api/cells().nodes()"><code class="api" title=
|
||||
"DataTables API method">cells().nodes()<span>DT</span></code></a> and <a href=
|
||||
"//datatables.net/reference/api/column().nodes()"><code class="api" title=
|
||||
"DataTables API method">column().nodes()<span>DT</span></code></a> methods to remove old classes and
|
||||
apply the new highlighted class, respectively.</p>
|
||||
</div>
|
||||
|
||||
<table id="example" class="row-border hover order-column" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Position</th>
|
||||
<th>Office</th>
|
||||
<th>Age</th>
|
||||
<th>Start date</th>
|
||||
<th>Salary</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Position</th>
|
||||
<th>Office</th>
|
||||
<th>Age</th>
|
||||
<th>Start date</th>
|
||||
<th>Salary</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Tiger Nixon</td>
|
||||
<td>System Architect</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>61</td>
|
||||
<td>2011/04/25</td>
|
||||
<td>$320,800</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Garrett Winters</td>
|
||||
<td>Accountant</td>
|
||||
<td>Tokyo</td>
|
||||
<td>63</td>
|
||||
<td>2011/07/25</td>
|
||||
<td>$170,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Ashton Cox</td>
|
||||
<td>Junior Technical Author</td>
|
||||
<td>San Francisco</td>
|
||||
<td>66</td>
|
||||
<td>2009/01/12</td>
|
||||
<td>$86,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cedric Kelly</td>
|
||||
<td>Senior Javascript Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>22</td>
|
||||
<td>2012/03/29</td>
|
||||
<td>$433,060</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Airi Satou</td>
|
||||
<td>Accountant</td>
|
||||
<td>Tokyo</td>
|
||||
<td>33</td>
|
||||
<td>2008/11/28</td>
|
||||
<td>$162,700</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Brielle Williamson</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>New York</td>
|
||||
<td>61</td>
|
||||
<td>2012/12/02</td>
|
||||
<td>$372,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Herrod Chandler</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>San Francisco</td>
|
||||
<td>59</td>
|
||||
<td>2012/08/06</td>
|
||||
<td>$137,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Rhona Davidson</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>Tokyo</td>
|
||||
<td>55</td>
|
||||
<td>2010/10/14</td>
|
||||
<td>$327,900</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Colleen Hurst</td>
|
||||
<td>Javascript Developer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>39</td>
|
||||
<td>2009/09/15</td>
|
||||
<td>$205,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sonya Frost</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>23</td>
|
||||
<td>2008/12/13</td>
|
||||
<td>$103,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jena Gaines</td>
|
||||
<td>Office Manager</td>
|
||||
<td>London</td>
|
||||
<td>30</td>
|
||||
<td>2008/12/19</td>
|
||||
<td>$90,560</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Quinn Flynn</td>
|
||||
<td>Support Lead</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>22</td>
|
||||
<td>2013/03/03</td>
|
||||
<td>$342,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Charde Marshall</td>
|
||||
<td>Regional Director</td>
|
||||
<td>San Francisco</td>
|
||||
<td>36</td>
|
||||
<td>2008/10/16</td>
|
||||
<td>$470,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Haley Kennedy</td>
|
||||
<td>Senior Marketing Designer</td>
|
||||
<td>London</td>
|
||||
<td>43</td>
|
||||
<td>2012/12/18</td>
|
||||
<td>$313,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Tatyana Fitzpatrick</td>
|
||||
<td>Regional Director</td>
|
||||
<td>London</td>
|
||||
<td>19</td>
|
||||
<td>2010/03/17</td>
|
||||
<td>$385,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Michael Silva</td>
|
||||
<td>Marketing Designer</td>
|
||||
<td>London</td>
|
||||
<td>66</td>
|
||||
<td>2012/11/27</td>
|
||||
<td>$198,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Paul Byrd</td>
|
||||
<td>Chief Financial Officer (CFO)</td>
|
||||
<td>New York</td>
|
||||
<td>64</td>
|
||||
<td>2010/06/09</td>
|
||||
<td>$725,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gloria Little</td>
|
||||
<td>Systems Administrator</td>
|
||||
<td>New York</td>
|
||||
<td>59</td>
|
||||
<td>2009/04/10</td>
|
||||
<td>$237,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bradley Greer</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>London</td>
|
||||
<td>41</td>
|
||||
<td>2012/10/13</td>
|
||||
<td>$132,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Dai Rios</td>
|
||||
<td>Personnel Lead</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>35</td>
|
||||
<td>2012/09/26</td>
|
||||
<td>$217,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jenette Caldwell</td>
|
||||
<td>Development Lead</td>
|
||||
<td>New York</td>
|
||||
<td>30</td>
|
||||
<td>2011/09/03</td>
|
||||
<td>$345,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Yuri Berry</td>
|
||||
<td>Chief Marketing Officer (CMO)</td>
|
||||
<td>New York</td>
|
||||
<td>40</td>
|
||||
<td>2009/06/25</td>
|
||||
<td>$675,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Caesar Vance</td>
|
||||
<td>Pre-Sales Support</td>
|
||||
<td>New York</td>
|
||||
<td>21</td>
|
||||
<td>2011/12/12</td>
|
||||
<td>$106,450</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Doris Wilder</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>Sidney</td>
|
||||
<td>23</td>
|
||||
<td>2010/09/20</td>
|
||||
<td>$85,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Angelica Ramos</td>
|
||||
<td>Chief Executive Officer (CEO)</td>
|
||||
<td>London</td>
|
||||
<td>47</td>
|
||||
<td>2009/10/09</td>
|
||||
<td>$1,200,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gavin Joyce</td>
|
||||
<td>Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>42</td>
|
||||
<td>2010/12/22</td>
|
||||
<td>$92,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jennifer Chang</td>
|
||||
<td>Regional Director</td>
|
||||
<td>Singapore</td>
|
||||
<td>28</td>
|
||||
<td>2010/11/14</td>
|
||||
<td>$357,650</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Brenden Wagner</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>28</td>
|
||||
<td>2011/06/07</td>
|
||||
<td>$206,850</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fiona Green</td>
|
||||
<td>Chief Operating Officer (COO)</td>
|
||||
<td>San Francisco</td>
|
||||
<td>48</td>
|
||||
<td>2010/03/11</td>
|
||||
<td>$850,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Shou Itou</td>
|
||||
<td>Regional Marketing</td>
|
||||
<td>Tokyo</td>
|
||||
<td>20</td>
|
||||
<td>2011/08/14</td>
|
||||
<td>$163,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Michelle House</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>Sidney</td>
|
||||
<td>37</td>
|
||||
<td>2011/06/02</td>
|
||||
<td>$95,400</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Suki Burks</td>
|
||||
<td>Developer</td>
|
||||
<td>London</td>
|
||||
<td>53</td>
|
||||
<td>2009/10/22</td>
|
||||
<td>$114,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Prescott Bartlett</td>
|
||||
<td>Technical Author</td>
|
||||
<td>London</td>
|
||||
<td>27</td>
|
||||
<td>2011/05/07</td>
|
||||
<td>$145,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gavin Cortez</td>
|
||||
<td>Team Leader</td>
|
||||
<td>San Francisco</td>
|
||||
<td>22</td>
|
||||
<td>2008/10/26</td>
|
||||
<td>$235,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Martena Mccray</td>
|
||||
<td>Post-Sales support</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>46</td>
|
||||
<td>2011/03/09</td>
|
||||
<td>$324,050</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Unity Butler</td>
|
||||
<td>Marketing Designer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>47</td>
|
||||
<td>2009/12/09</td>
|
||||
<td>$85,675</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Howard Hatfield</td>
|
||||
<td>Office Manager</td>
|
||||
<td>San Francisco</td>
|
||||
<td>51</td>
|
||||
<td>2008/12/16</td>
|
||||
<td>$164,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hope Fuentes</td>
|
||||
<td>Secretary</td>
|
||||
<td>San Francisco</td>
|
||||
<td>41</td>
|
||||
<td>2010/02/12</td>
|
||||
<td>$109,850</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Vivian Harrell</td>
|
||||
<td>Financial Controller</td>
|
||||
<td>San Francisco</td>
|
||||
<td>62</td>
|
||||
<td>2009/02/14</td>
|
||||
<td>$452,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Timothy Mooney</td>
|
||||
<td>Office Manager</td>
|
||||
<td>London</td>
|
||||
<td>37</td>
|
||||
<td>2008/12/11</td>
|
||||
<td>$136,200</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jackson Bradshaw</td>
|
||||
<td>Director</td>
|
||||
<td>New York</td>
|
||||
<td>65</td>
|
||||
<td>2008/09/26</td>
|
||||
<td>$645,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Olivia Liang</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>Singapore</td>
|
||||
<td>64</td>
|
||||
<td>2011/02/03</td>
|
||||
<td>$234,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruno Nash</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>London</td>
|
||||
<td>38</td>
|
||||
<td>2011/05/03</td>
|
||||
<td>$163,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sakura Yamamoto</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>Tokyo</td>
|
||||
<td>37</td>
|
||||
<td>2009/08/19</td>
|
||||
<td>$139,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Thor Walton</td>
|
||||
<td>Developer</td>
|
||||
<td>New York</td>
|
||||
<td>61</td>
|
||||
<td>2013/08/11</td>
|
||||
<td>$98,540</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Finn Camacho</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>47</td>
|
||||
<td>2009/07/07</td>
|
||||
<td>$87,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Serge Baldwin</td>
|
||||
<td>Data Coordinator</td>
|
||||
<td>Singapore</td>
|
||||
<td>64</td>
|
||||
<td>2012/04/09</td>
|
||||
<td>$138,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Zenaida Frank</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>New York</td>
|
||||
<td>63</td>
|
||||
<td>2010/01/04</td>
|
||||
<td>$125,250</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Zorita Serrano</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>56</td>
|
||||
<td>2012/06/01</td>
|
||||
<td>$115,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jennifer Acosta</td>
|
||||
<td>Junior Javascript Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>43</td>
|
||||
<td>2013/02/01</td>
|
||||
<td>$75,650</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cara Stevens</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>New York</td>
|
||||
<td>46</td>
|
||||
<td>2011/12/06</td>
|
||||
<td>$145,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hermione Butler</td>
|
||||
<td>Regional Director</td>
|
||||
<td>London</td>
|
||||
<td>47</td>
|
||||
<td>2011/03/21</td>
|
||||
<td>$356,250</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Lael Greer</td>
|
||||
<td>Systems Administrator</td>
|
||||
<td>London</td>
|
||||
<td>21</td>
|
||||
<td>2009/02/27</td>
|
||||
<td>$103,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jonas Alexander</td>
|
||||
<td>Developer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>30</td>
|
||||
<td>2010/07/14</td>
|
||||
<td>$86,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Shad Decker</td>
|
||||
<td>Regional Director</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>51</td>
|
||||
<td>2008/11/13</td>
|
||||
<td>$183,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Michael Bruce</td>
|
||||
<td>Javascript Developer</td>
|
||||
<td>Singapore</td>
|
||||
<td>29</td>
|
||||
<td>2011/06/27</td>
|
||||
<td>$183,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Donna Snider</td>
|
||||
<td>Customer Support</td>
|
||||
<td>New York</td>
|
||||
<td>27</td>
|
||||
<td>2011/01/25</td>
|
||||
<td>$112,000</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 brush: js;">$(document).ready(function() {
|
||||
var lastIdx = null;
|
||||
var table = $('#example').DataTable();
|
||||
|
||||
$('#example tbody')
|
||||
.on( 'mouseover', 'td', function () {
|
||||
var colIdx = table.cell(this).index().column;
|
||||
|
||||
if ( colIdx !== lastIdx ) {
|
||||
$( table.cells().nodes() ).removeClass( 'highlight' );
|
||||
$( table.column( colIdx ).nodes() ).addClass( 'highlight' );
|
||||
}
|
||||
} )
|
||||
.on( 'mouseleave', function () {
|
||||
$( table.cells().nodes() ).removeClass( 'highlight' );
|
||||
} );
|
||||
} );</code>
|
||||
|
||||
<p>In addition to the above code, the following Javascript library files are loaded for use in this
|
||||
example:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="../../media/js/jquery.js">../../media/js/jquery.js</a></li>
|
||||
<li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="table">
|
||||
<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 brush: js;">td.highlight {
|
||||
background-color: whitesmoke !important;
|
||||
}</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>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<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_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/scroll_y_theme.html">Scroll - vertical with jQuery UI
|
||||
ThemeRoller</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 (rowspan /
|
||||
colspan)</a></li>
|
||||
<li><a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes</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</a></li>
|
||||
<li><a href="../styling/foundation.html">Foundation</a></li>
|
||||
<li><a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</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 class="active"><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 jQuery UI 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/extras">extras</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-2014<br>
|
||||
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
71
app/static/global/plugins/datatables/examples/api/index.html
Normal file
71
app/static/global/plugins/datatables/examples/api/index.html
Normal file
@ -0,0 +1,71 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<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">
|
||||
<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="../../media/js/jquery.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>
|
||||
|
||||
<title>DataTables examples - API</title>
|
||||
</head>
|
||||
|
||||
<body class="dt-example">
|
||||
<div class="container">
|
||||
<section>
|
||||
<h1>DataTables example <span>API</span></h1>
|
||||
|
||||
<div class="info">
|
||||
<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>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<section>
|
||||
<div class="footer">
|
||||
<div class="gradient"></div>
|
||||
|
||||
<div class="liner">
|
||||
<div class="toc">
|
||||
<div class="toc-group">
|
||||
<h3><a href="./index.html">API</a></h3>
|
||||
<ul class="toc">
|
||||
<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><a href="./tabs_and_scrolling.html">Scrolling and jQuery UI tabs</a></li>
|
||||
<li><a href="./regex.html">Search API (regular expressions)</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/extras">extras</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-2014<br>
|
||||
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,812 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<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">
|
||||
|
||||
<title>DataTables example - Individual column searching (text inputs)</title>
|
||||
<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">
|
||||
|
||||
tfoot input {
|
||||
width: 100%;
|
||||
padding: 3px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script type="text/javascript" language="javascript" src="../../media/js/jquery.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 type="text/javascript" language="javascript" class="init">
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
// Setup - add a text input to each footer cell
|
||||
$('#example tfoot th').each( function () {
|
||||
var title = $('#example thead th').eq( $(this).index() ).text();
|
||||
$(this).html( '<input type="text" placeholder="Search '+title+'" />' );
|
||||
} );
|
||||
|
||||
// DataTable
|
||||
var table = $('#example').DataTable();
|
||||
|
||||
// Apply the search
|
||||
table.columns().eq( 0 ).each( function ( colIdx ) {
|
||||
$( 'input', table.column( colIdx ).footer() ).on( 'keyup change', function () {
|
||||
table
|
||||
.column( colIdx )
|
||||
.search( this.value )
|
||||
.draw();
|
||||
} );
|
||||
} );
|
||||
} );
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body class="dt-example">
|
||||
<div class="container">
|
||||
<section>
|
||||
<h1>DataTables example <span>Individual column searching (text inputs)</span></h1>
|
||||
|
||||
<div class="info">
|
||||
<p>The searching functionality that is provided by DataTables is very useful for quickly search through
|
||||
the information in the table - however the search is global, and you may wish to present controls to
|
||||
search on specific columns only.</p>
|
||||
|
||||
<p>DataTables has the ability to apply searching to a specific column through the <a href=
|
||||
"//datatables.net/reference/api/column().search()"><code class="api" title=
|
||||
"DataTables API method">column().search()<span>DT</span></code></a> method (note that the name of the
|
||||
method is <code>search</code> not <code>filter</code> since <a href=
|
||||
"//datatables.net/reference/api/filter()"><code class="api" title=
|
||||
"DataTables API method">filter()<span>DT</span></code></a> is used to apply a filter to a result
|
||||
set).</p>
|
||||
|
||||
<p>The column searches are cumulative, so you can apply multiple individual column searchs, in addition
|
||||
to the global search, allowing complex searching options to be presented to the user.</p>
|
||||
|
||||
<p>This examples shows text elements being used with the <a href=
|
||||
"//datatables.net/reference/api/column().search()"><code class="api" title=
|
||||
"DataTables API method">column().search()<span>DT</span></code></a> method to add input controls in the
|
||||
footer of the table for each column. Note that the <code>*index*:visible</code> option is used for the
|
||||
column selector to ensure that the <a href="//datatables.net/reference/api/column()"><code class="api"
|
||||
title="DataTables API method">column()<span>DT</span></code></a> method takes into account any hidden
|
||||
columns when selecting the column to act upon.</p>
|
||||
</div>
|
||||
|
||||
<table id="example" class="display" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Position</th>
|
||||
<th>Office</th>
|
||||
<th>Age</th>
|
||||
<th>Start date</th>
|
||||
<th>Salary</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Position</th>
|
||||
<th>Office</th>
|
||||
<th>Age</th>
|
||||
<th>Start date</th>
|
||||
<th>Salary</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Tiger Nixon</td>
|
||||
<td>System Architect</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>61</td>
|
||||
<td>2011/04/25</td>
|
||||
<td>$320,800</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Garrett Winters</td>
|
||||
<td>Accountant</td>
|
||||
<td>Tokyo</td>
|
||||
<td>63</td>
|
||||
<td>2011/07/25</td>
|
||||
<td>$170,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Ashton Cox</td>
|
||||
<td>Junior Technical Author</td>
|
||||
<td>San Francisco</td>
|
||||
<td>66</td>
|
||||
<td>2009/01/12</td>
|
||||
<td>$86,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cedric Kelly</td>
|
||||
<td>Senior Javascript Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>22</td>
|
||||
<td>2012/03/29</td>
|
||||
<td>$433,060</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Airi Satou</td>
|
||||
<td>Accountant</td>
|
||||
<td>Tokyo</td>
|
||||
<td>33</td>
|
||||
<td>2008/11/28</td>
|
||||
<td>$162,700</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Brielle Williamson</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>New York</td>
|
||||
<td>61</td>
|
||||
<td>2012/12/02</td>
|
||||
<td>$372,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Herrod Chandler</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>San Francisco</td>
|
||||
<td>59</td>
|
||||
<td>2012/08/06</td>
|
||||
<td>$137,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Rhona Davidson</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>Tokyo</td>
|
||||
<td>55</td>
|
||||
<td>2010/10/14</td>
|
||||
<td>$327,900</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Colleen Hurst</td>
|
||||
<td>Javascript Developer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>39</td>
|
||||
<td>2009/09/15</td>
|
||||
<td>$205,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sonya Frost</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>23</td>
|
||||
<td>2008/12/13</td>
|
||||
<td>$103,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jena Gaines</td>
|
||||
<td>Office Manager</td>
|
||||
<td>London</td>
|
||||
<td>30</td>
|
||||
<td>2008/12/19</td>
|
||||
<td>$90,560</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Quinn Flynn</td>
|
||||
<td>Support Lead</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>22</td>
|
||||
<td>2013/03/03</td>
|
||||
<td>$342,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Charde Marshall</td>
|
||||
<td>Regional Director</td>
|
||||
<td>San Francisco</td>
|
||||
<td>36</td>
|
||||
<td>2008/10/16</td>
|
||||
<td>$470,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Haley Kennedy</td>
|
||||
<td>Senior Marketing Designer</td>
|
||||
<td>London</td>
|
||||
<td>43</td>
|
||||
<td>2012/12/18</td>
|
||||
<td>$313,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Tatyana Fitzpatrick</td>
|
||||
<td>Regional Director</td>
|
||||
<td>London</td>
|
||||
<td>19</td>
|
||||
<td>2010/03/17</td>
|
||||
<td>$385,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Michael Silva</td>
|
||||
<td>Marketing Designer</td>
|
||||
<td>London</td>
|
||||
<td>66</td>
|
||||
<td>2012/11/27</td>
|
||||
<td>$198,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Paul Byrd</td>
|
||||
<td>Chief Financial Officer (CFO)</td>
|
||||
<td>New York</td>
|
||||
<td>64</td>
|
||||
<td>2010/06/09</td>
|
||||
<td>$725,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gloria Little</td>
|
||||
<td>Systems Administrator</td>
|
||||
<td>New York</td>
|
||||
<td>59</td>
|
||||
<td>2009/04/10</td>
|
||||
<td>$237,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bradley Greer</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>London</td>
|
||||
<td>41</td>
|
||||
<td>2012/10/13</td>
|
||||
<td>$132,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Dai Rios</td>
|
||||
<td>Personnel Lead</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>35</td>
|
||||
<td>2012/09/26</td>
|
||||
<td>$217,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jenette Caldwell</td>
|
||||
<td>Development Lead</td>
|
||||
<td>New York</td>
|
||||
<td>30</td>
|
||||
<td>2011/09/03</td>
|
||||
<td>$345,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Yuri Berry</td>
|
||||
<td>Chief Marketing Officer (CMO)</td>
|
||||
<td>New York</td>
|
||||
<td>40</td>
|
||||
<td>2009/06/25</td>
|
||||
<td>$675,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Caesar Vance</td>
|
||||
<td>Pre-Sales Support</td>
|
||||
<td>New York</td>
|
||||
<td>21</td>
|
||||
<td>2011/12/12</td>
|
||||
<td>$106,450</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Doris Wilder</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>Sidney</td>
|
||||
<td>23</td>
|
||||
<td>2010/09/20</td>
|
||||
<td>$85,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Angelica Ramos</td>
|
||||
<td>Chief Executive Officer (CEO)</td>
|
||||
<td>London</td>
|
||||
<td>47</td>
|
||||
<td>2009/10/09</td>
|
||||
<td>$1,200,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gavin Joyce</td>
|
||||
<td>Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>42</td>
|
||||
<td>2010/12/22</td>
|
||||
<td>$92,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jennifer Chang</td>
|
||||
<td>Regional Director</td>
|
||||
<td>Singapore</td>
|
||||
<td>28</td>
|
||||
<td>2010/11/14</td>
|
||||
<td>$357,650</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Brenden Wagner</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>28</td>
|
||||
<td>2011/06/07</td>
|
||||
<td>$206,850</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fiona Green</td>
|
||||
<td>Chief Operating Officer (COO)</td>
|
||||
<td>San Francisco</td>
|
||||
<td>48</td>
|
||||
<td>2010/03/11</td>
|
||||
<td>$850,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Shou Itou</td>
|
||||
<td>Regional Marketing</td>
|
||||
<td>Tokyo</td>
|
||||
<td>20</td>
|
||||
<td>2011/08/14</td>
|
||||
<td>$163,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Michelle House</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>Sidney</td>
|
||||
<td>37</td>
|
||||
<td>2011/06/02</td>
|
||||
<td>$95,400</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Suki Burks</td>
|
||||
<td>Developer</td>
|
||||
<td>London</td>
|
||||
<td>53</td>
|
||||
<td>2009/10/22</td>
|
||||
<td>$114,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Prescott Bartlett</td>
|
||||
<td>Technical Author</td>
|
||||
<td>London</td>
|
||||
<td>27</td>
|
||||
<td>2011/05/07</td>
|
||||
<td>$145,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gavin Cortez</td>
|
||||
<td>Team Leader</td>
|
||||
<td>San Francisco</td>
|
||||
<td>22</td>
|
||||
<td>2008/10/26</td>
|
||||
<td>$235,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Martena Mccray</td>
|
||||
<td>Post-Sales support</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>46</td>
|
||||
<td>2011/03/09</td>
|
||||
<td>$324,050</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Unity Butler</td>
|
||||
<td>Marketing Designer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>47</td>
|
||||
<td>2009/12/09</td>
|
||||
<td>$85,675</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Howard Hatfield</td>
|
||||
<td>Office Manager</td>
|
||||
<td>San Francisco</td>
|
||||
<td>51</td>
|
||||
<td>2008/12/16</td>
|
||||
<td>$164,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hope Fuentes</td>
|
||||
<td>Secretary</td>
|
||||
<td>San Francisco</td>
|
||||
<td>41</td>
|
||||
<td>2010/02/12</td>
|
||||
<td>$109,850</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Vivian Harrell</td>
|
||||
<td>Financial Controller</td>
|
||||
<td>San Francisco</td>
|
||||
<td>62</td>
|
||||
<td>2009/02/14</td>
|
||||
<td>$452,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Timothy Mooney</td>
|
||||
<td>Office Manager</td>
|
||||
<td>London</td>
|
||||
<td>37</td>
|
||||
<td>2008/12/11</td>
|
||||
<td>$136,200</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jackson Bradshaw</td>
|
||||
<td>Director</td>
|
||||
<td>New York</td>
|
||||
<td>65</td>
|
||||
<td>2008/09/26</td>
|
||||
<td>$645,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Olivia Liang</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>Singapore</td>
|
||||
<td>64</td>
|
||||
<td>2011/02/03</td>
|
||||
<td>$234,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruno Nash</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>London</td>
|
||||
<td>38</td>
|
||||
<td>2011/05/03</td>
|
||||
<td>$163,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sakura Yamamoto</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>Tokyo</td>
|
||||
<td>37</td>
|
||||
<td>2009/08/19</td>
|
||||
<td>$139,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Thor Walton</td>
|
||||
<td>Developer</td>
|
||||
<td>New York</td>
|
||||
<td>61</td>
|
||||
<td>2013/08/11</td>
|
||||
<td>$98,540</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Finn Camacho</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>47</td>
|
||||
<td>2009/07/07</td>
|
||||
<td>$87,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Serge Baldwin</td>
|
||||
<td>Data Coordinator</td>
|
||||
<td>Singapore</td>
|
||||
<td>64</td>
|
||||
<td>2012/04/09</td>
|
||||
<td>$138,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Zenaida Frank</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>New York</td>
|
||||
<td>63</td>
|
||||
<td>2010/01/04</td>
|
||||
<td>$125,250</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Zorita Serrano</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>56</td>
|
||||
<td>2012/06/01</td>
|
||||
<td>$115,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jennifer Acosta</td>
|
||||
<td>Junior Javascript Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>43</td>
|
||||
<td>2013/02/01</td>
|
||||
<td>$75,650</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cara Stevens</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>New York</td>
|
||||
<td>46</td>
|
||||
<td>2011/12/06</td>
|
||||
<td>$145,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hermione Butler</td>
|
||||
<td>Regional Director</td>
|
||||
<td>London</td>
|
||||
<td>47</td>
|
||||
<td>2011/03/21</td>
|
||||
<td>$356,250</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Lael Greer</td>
|
||||
<td>Systems Administrator</td>
|
||||
<td>London</td>
|
||||
<td>21</td>
|
||||
<td>2009/02/27</td>
|
||||
<td>$103,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jonas Alexander</td>
|
||||
<td>Developer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>30</td>
|
||||
<td>2010/07/14</td>
|
||||
<td>$86,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Shad Decker</td>
|
||||
<td>Regional Director</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>51</td>
|
||||
<td>2008/11/13</td>
|
||||
<td>$183,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Michael Bruce</td>
|
||||
<td>Javascript Developer</td>
|
||||
<td>Singapore</td>
|
||||
<td>29</td>
|
||||
<td>2011/06/27</td>
|
||||
<td>$183,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Donna Snider</td>
|
||||
<td>Customer Support</td>
|
||||
<td>New York</td>
|
||||
<td>27</td>
|
||||
<td>2011/01/25</td>
|
||||
<td>$112,000</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 brush: js;">$(document).ready(function() {
|
||||
// Setup - add a text input to each footer cell
|
||||
$('#example tfoot th').each( function () {
|
||||
var title = $('#example thead th').eq( $(this).index() ).text();
|
||||
$(this).html( '<input type="text" placeholder="Search '+title+'" />' );
|
||||
} );
|
||||
|
||||
// DataTable
|
||||
var table = $('#example').DataTable();
|
||||
|
||||
// Apply the search
|
||||
table.columns().eq( 0 ).each( function ( colIdx ) {
|
||||
$( 'input', table.column( colIdx ).footer() ).on( 'keyup change', function () {
|
||||
table
|
||||
.column( colIdx )
|
||||
.search( this.value )
|
||||
.draw();
|
||||
} );
|
||||
} );
|
||||
} );</code>
|
||||
|
||||
<p>In addition to the above code, the following Javascript library files are loaded for use in this
|
||||
example:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="../../media/js/jquery.js">../../media/js/jquery.js</a></li>
|
||||
<li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="table">
|
||||
<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 brush: js;">tfoot input {
|
||||
width: 100%;
|
||||
padding: 3px;
|
||||
box-sizing: border-box;
|
||||
}</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>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<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_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/scroll_y_theme.html">Scroll - vertical with jQuery UI
|
||||
ThemeRoller</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 (rowspan /
|
||||
colspan)</a></li>
|
||||
<li><a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes</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</a></li>
|
||||
<li><a href="../styling/foundation.html">Foundation</a></li>
|
||||
<li><a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</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 class="active"><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 jQuery UI 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/extras">extras</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-2014<br>
|
||||
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,802 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<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">
|
||||
|
||||
<title>DataTables example - Individual column searching (select inputs)</title>
|
||||
<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>
|
||||
<script type="text/javascript" language="javascript" src="../../media/js/jquery.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 type="text/javascript" language="javascript" class="init">
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
var table = $('#example').DataTable();
|
||||
|
||||
$("#example tfoot th").each( function ( i ) {
|
||||
var select = $('<select><option value=""></option></select>')
|
||||
.appendTo( $(this).empty() )
|
||||
.on( 'change', function () {
|
||||
var val = $(this).val();
|
||||
|
||||
table.column( i )
|
||||
.search( val ? '^'+$(this).val()+'$' : val, true, false )
|
||||
.draw();
|
||||
} );
|
||||
|
||||
table.column( i ).data().unique().sort().each( function ( d, j ) {
|
||||
select.append( '<option value="'+d+'">'+d+'</option>' )
|
||||
} );
|
||||
} );
|
||||
} );
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body class="dt-example">
|
||||
<div class="container">
|
||||
<section>
|
||||
<h1>DataTables example <span>Individual column searching (select inputs)</span></h1>
|
||||
|
||||
<div class="info">
|
||||
<p>This example is almost identical to text based individual column example and provides the same
|
||||
functionality, but in this case using <code class="tag" title="HTML tag">select</code> input
|
||||
controls.</p>
|
||||
|
||||
<p>After the table is initialised, the API is used to build the <code class="tag" title=
|
||||
"HTML tag">select</code> inputs through the use of the <a href=
|
||||
"//datatables.net/reference/api/column().data()"><code class="api" title=
|
||||
"DataTables API method">column().data()<span>DT</span></code></a> method to get the data for each
|
||||
column in turn. The helper methods <a href="//datatables.net/reference/api/unique()"><code class="api"
|
||||
title="DataTables API method">unique()<span>DT</span></code></a> and <a href=
|
||||
"//datatables.net/reference/api/sort()"><code class="api" title=
|
||||
"DataTables API method">sort()<span>DT</span></code></a> are also used to reduce the data for set input
|
||||
to unique and ordered elements. Finally the <code>change</code> event from the <code class="tag" title=
|
||||
"HTML tag">select</code> input is used to trigger a column search using the <a href=
|
||||
"//datatables.net/reference/api/column().search()"><code class="api" title=
|
||||
"DataTables API method">column().search()<span>DT</span></code></a> method.</p>
|
||||
|
||||
<p>Note that the <a href="//datatables.net/reference/api/column().search()"><code class="api" title=
|
||||
"DataTables API method">column().search()<span>DT</span></code></a> method in this particular case
|
||||
performs an exact match through the use of a custom regular expression and disabling DataTables built
|
||||
in smart searching. For more information on the search options in DataTables API please refer to the
|
||||
documentation for <a href="//datatables.net/reference/api/search()"><code class="api" title=
|
||||
"DataTables API method">search()<span>DT</span></code></a> and <a href=
|
||||
"//datatables.net/reference/api/column().search()"><code class="api" title=
|
||||
"DataTables API method">column().search()<span>DT</span></code></a>.</p>
|
||||
</div>
|
||||
|
||||
<table id="example" class="display" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Position</th>
|
||||
<th>Office</th>
|
||||
<th>Age</th>
|
||||
<th>Start date</th>
|
||||
<th>Salary</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Position</th>
|
||||
<th>Office</th>
|
||||
<th>Age</th>
|
||||
<th>Start date</th>
|
||||
<th>Salary</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Tiger Nixon</td>
|
||||
<td>System Architect</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>61</td>
|
||||
<td>2011/04/25</td>
|
||||
<td>$320,800</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Garrett Winters</td>
|
||||
<td>Accountant</td>
|
||||
<td>Tokyo</td>
|
||||
<td>63</td>
|
||||
<td>2011/07/25</td>
|
||||
<td>$170,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Ashton Cox</td>
|
||||
<td>Junior Technical Author</td>
|
||||
<td>San Francisco</td>
|
||||
<td>66</td>
|
||||
<td>2009/01/12</td>
|
||||
<td>$86,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cedric Kelly</td>
|
||||
<td>Senior Javascript Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>22</td>
|
||||
<td>2012/03/29</td>
|
||||
<td>$433,060</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Airi Satou</td>
|
||||
<td>Accountant</td>
|
||||
<td>Tokyo</td>
|
||||
<td>33</td>
|
||||
<td>2008/11/28</td>
|
||||
<td>$162,700</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Brielle Williamson</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>New York</td>
|
||||
<td>61</td>
|
||||
<td>2012/12/02</td>
|
||||
<td>$372,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Herrod Chandler</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>San Francisco</td>
|
||||
<td>59</td>
|
||||
<td>2012/08/06</td>
|
||||
<td>$137,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Rhona Davidson</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>Tokyo</td>
|
||||
<td>55</td>
|
||||
<td>2010/10/14</td>
|
||||
<td>$327,900</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Colleen Hurst</td>
|
||||
<td>Javascript Developer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>39</td>
|
||||
<td>2009/09/15</td>
|
||||
<td>$205,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sonya Frost</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>23</td>
|
||||
<td>2008/12/13</td>
|
||||
<td>$103,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jena Gaines</td>
|
||||
<td>Office Manager</td>
|
||||
<td>London</td>
|
||||
<td>30</td>
|
||||
<td>2008/12/19</td>
|
||||
<td>$90,560</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Quinn Flynn</td>
|
||||
<td>Support Lead</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>22</td>
|
||||
<td>2013/03/03</td>
|
||||
<td>$342,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Charde Marshall</td>
|
||||
<td>Regional Director</td>
|
||||
<td>San Francisco</td>
|
||||
<td>36</td>
|
||||
<td>2008/10/16</td>
|
||||
<td>$470,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Haley Kennedy</td>
|
||||
<td>Senior Marketing Designer</td>
|
||||
<td>London</td>
|
||||
<td>43</td>
|
||||
<td>2012/12/18</td>
|
||||
<td>$313,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Tatyana Fitzpatrick</td>
|
||||
<td>Regional Director</td>
|
||||
<td>London</td>
|
||||
<td>19</td>
|
||||
<td>2010/03/17</td>
|
||||
<td>$385,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Michael Silva</td>
|
||||
<td>Marketing Designer</td>
|
||||
<td>London</td>
|
||||
<td>66</td>
|
||||
<td>2012/11/27</td>
|
||||
<td>$198,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Paul Byrd</td>
|
||||
<td>Chief Financial Officer (CFO)</td>
|
||||
<td>New York</td>
|
||||
<td>64</td>
|
||||
<td>2010/06/09</td>
|
||||
<td>$725,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gloria Little</td>
|
||||
<td>Systems Administrator</td>
|
||||
<td>New York</td>
|
||||
<td>59</td>
|
||||
<td>2009/04/10</td>
|
||||
<td>$237,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bradley Greer</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>London</td>
|
||||
<td>41</td>
|
||||
<td>2012/10/13</td>
|
||||
<td>$132,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Dai Rios</td>
|
||||
<td>Personnel Lead</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>35</td>
|
||||
<td>2012/09/26</td>
|
||||
<td>$217,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jenette Caldwell</td>
|
||||
<td>Development Lead</td>
|
||||
<td>New York</td>
|
||||
<td>30</td>
|
||||
<td>2011/09/03</td>
|
||||
<td>$345,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Yuri Berry</td>
|
||||
<td>Chief Marketing Officer (CMO)</td>
|
||||
<td>New York</td>
|
||||
<td>40</td>
|
||||
<td>2009/06/25</td>
|
||||
<td>$675,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Caesar Vance</td>
|
||||
<td>Pre-Sales Support</td>
|
||||
<td>New York</td>
|
||||
<td>21</td>
|
||||
<td>2011/12/12</td>
|
||||
<td>$106,450</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Doris Wilder</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>Sidney</td>
|
||||
<td>23</td>
|
||||
<td>2010/09/20</td>
|
||||
<td>$85,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Angelica Ramos</td>
|
||||
<td>Chief Executive Officer (CEO)</td>
|
||||
<td>London</td>
|
||||
<td>47</td>
|
||||
<td>2009/10/09</td>
|
||||
<td>$1,200,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gavin Joyce</td>
|
||||
<td>Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>42</td>
|
||||
<td>2010/12/22</td>
|
||||
<td>$92,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jennifer Chang</td>
|
||||
<td>Regional Director</td>
|
||||
<td>Singapore</td>
|
||||
<td>28</td>
|
||||
<td>2010/11/14</td>
|
||||
<td>$357,650</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Brenden Wagner</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>28</td>
|
||||
<td>2011/06/07</td>
|
||||
<td>$206,850</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fiona Green</td>
|
||||
<td>Chief Operating Officer (COO)</td>
|
||||
<td>San Francisco</td>
|
||||
<td>48</td>
|
||||
<td>2010/03/11</td>
|
||||
<td>$850,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Shou Itou</td>
|
||||
<td>Regional Marketing</td>
|
||||
<td>Tokyo</td>
|
||||
<td>20</td>
|
||||
<td>2011/08/14</td>
|
||||
<td>$163,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Michelle House</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>Sidney</td>
|
||||
<td>37</td>
|
||||
<td>2011/06/02</td>
|
||||
<td>$95,400</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Suki Burks</td>
|
||||
<td>Developer</td>
|
||||
<td>London</td>
|
||||
<td>53</td>
|
||||
<td>2009/10/22</td>
|
||||
<td>$114,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Prescott Bartlett</td>
|
||||
<td>Technical Author</td>
|
||||
<td>London</td>
|
||||
<td>27</td>
|
||||
<td>2011/05/07</td>
|
||||
<td>$145,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gavin Cortez</td>
|
||||
<td>Team Leader</td>
|
||||
<td>San Francisco</td>
|
||||
<td>22</td>
|
||||
<td>2008/10/26</td>
|
||||
<td>$235,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Martena Mccray</td>
|
||||
<td>Post-Sales support</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>46</td>
|
||||
<td>2011/03/09</td>
|
||||
<td>$324,050</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Unity Butler</td>
|
||||
<td>Marketing Designer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>47</td>
|
||||
<td>2009/12/09</td>
|
||||
<td>$85,675</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Howard Hatfield</td>
|
||||
<td>Office Manager</td>
|
||||
<td>San Francisco</td>
|
||||
<td>51</td>
|
||||
<td>2008/12/16</td>
|
||||
<td>$164,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hope Fuentes</td>
|
||||
<td>Secretary</td>
|
||||
<td>San Francisco</td>
|
||||
<td>41</td>
|
||||
<td>2010/02/12</td>
|
||||
<td>$109,850</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Vivian Harrell</td>
|
||||
<td>Financial Controller</td>
|
||||
<td>San Francisco</td>
|
||||
<td>62</td>
|
||||
<td>2009/02/14</td>
|
||||
<td>$452,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Timothy Mooney</td>
|
||||
<td>Office Manager</td>
|
||||
<td>London</td>
|
||||
<td>37</td>
|
||||
<td>2008/12/11</td>
|
||||
<td>$136,200</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jackson Bradshaw</td>
|
||||
<td>Director</td>
|
||||
<td>New York</td>
|
||||
<td>65</td>
|
||||
<td>2008/09/26</td>
|
||||
<td>$645,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Olivia Liang</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>Singapore</td>
|
||||
<td>64</td>
|
||||
<td>2011/02/03</td>
|
||||
<td>$234,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruno Nash</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>London</td>
|
||||
<td>38</td>
|
||||
<td>2011/05/03</td>
|
||||
<td>$163,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sakura Yamamoto</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>Tokyo</td>
|
||||
<td>37</td>
|
||||
<td>2009/08/19</td>
|
||||
<td>$139,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Thor Walton</td>
|
||||
<td>Developer</td>
|
||||
<td>New York</td>
|
||||
<td>61</td>
|
||||
<td>2013/08/11</td>
|
||||
<td>$98,540</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Finn Camacho</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>47</td>
|
||||
<td>2009/07/07</td>
|
||||
<td>$87,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Serge Baldwin</td>
|
||||
<td>Data Coordinator</td>
|
||||
<td>Singapore</td>
|
||||
<td>64</td>
|
||||
<td>2012/04/09</td>
|
||||
<td>$138,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Zenaida Frank</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>New York</td>
|
||||
<td>63</td>
|
||||
<td>2010/01/04</td>
|
||||
<td>$125,250</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Zorita Serrano</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>56</td>
|
||||
<td>2012/06/01</td>
|
||||
<td>$115,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jennifer Acosta</td>
|
||||
<td>Junior Javascript Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>43</td>
|
||||
<td>2013/02/01</td>
|
||||
<td>$75,650</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cara Stevens</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>New York</td>
|
||||
<td>46</td>
|
||||
<td>2011/12/06</td>
|
||||
<td>$145,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hermione Butler</td>
|
||||
<td>Regional Director</td>
|
||||
<td>London</td>
|
||||
<td>47</td>
|
||||
<td>2011/03/21</td>
|
||||
<td>$356,250</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Lael Greer</td>
|
||||
<td>Systems Administrator</td>
|
||||
<td>London</td>
|
||||
<td>21</td>
|
||||
<td>2009/02/27</td>
|
||||
<td>$103,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jonas Alexander</td>
|
||||
<td>Developer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>30</td>
|
||||
<td>2010/07/14</td>
|
||||
<td>$86,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Shad Decker</td>
|
||||
<td>Regional Director</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>51</td>
|
||||
<td>2008/11/13</td>
|
||||
<td>$183,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Michael Bruce</td>
|
||||
<td>Javascript Developer</td>
|
||||
<td>Singapore</td>
|
||||
<td>29</td>
|
||||
<td>2011/06/27</td>
|
||||
<td>$183,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Donna Snider</td>
|
||||
<td>Customer Support</td>
|
||||
<td>New York</td>
|
||||
<td>27</td>
|
||||
<td>2011/01/25</td>
|
||||
<td>$112,000</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 brush: js;">$(document).ready(function() {
|
||||
var table = $('#example').DataTable();
|
||||
|
||||
$("#example tfoot th").each( function ( i ) {
|
||||
var select = $('<select><option value=""></option></select>')
|
||||
.appendTo( $(this).empty() )
|
||||
.on( 'change', function () {
|
||||
var val = $(this).val();
|
||||
|
||||
table.column( i )
|
||||
.search( val ? '^'+$(this).val()+'$' : val, true, false )
|
||||
.draw();
|
||||
} );
|
||||
|
||||
table.column( i ).data().unique().sort().each( function ( d, j ) {
|
||||
select.append( '<option value="'+d+'">'+d+'</option>' )
|
||||
} );
|
||||
} );
|
||||
} );</code>
|
||||
|
||||
<p>In addition to the above code, the following Javascript library files are loaded for use in this
|
||||
example:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="../../media/js/jquery.js">../../media/js/jquery.js</a></li>
|
||||
<li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="table">
|
||||
<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 brush: js;"></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>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<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_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/scroll_y_theme.html">Scroll - vertical with jQuery UI
|
||||
ThemeRoller</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 (rowspan /
|
||||
colspan)</a></li>
|
||||
<li><a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes</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</a></li>
|
||||
<li><a href="../styling/foundation.html">Foundation</a></li>
|
||||
<li><a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</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 class="active"><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 jQuery UI 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/extras">extras</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-2014<br>
|
||||
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
873
app/static/global/plugins/datatables/examples/api/regex.html
Normal file
873
app/static/global/plugins/datatables/examples/api/regex.html
Normal file
@ -0,0 +1,873 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<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">
|
||||
|
||||
<title>DataTables example - Search API (regular expressions)</title>
|
||||
<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>
|
||||
<script type="text/javascript" language="javascript" src="../../media/js/jquery.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 type="text/javascript" language="javascript" class="init">
|
||||
|
||||
|
||||
function filterGlobal () {
|
||||
$('#example').DataTable().search(
|
||||
$('#global_filter').val(),
|
||||
$('#global_regex').prop('checked'),
|
||||
$('#global_smart').prop('checked')
|
||||
).draw();
|
||||
}
|
||||
|
||||
function filterColumn ( i ) {
|
||||
$('#example').DataTable().column( i ).search(
|
||||
$('#col'+i+'_filter').val(),
|
||||
$('#col'+i+'_regex').prop('checked'),
|
||||
$('#col'+i+'_smart').prop('checked')
|
||||
).draw();
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#example').dataTable();
|
||||
|
||||
$('input.global_filter').on( 'keyup click', function () {
|
||||
filterGlobal();
|
||||
} );
|
||||
|
||||
$('input.column_filter').on( 'keyup click', function () {
|
||||
filterColumn( $(this).parents('tr').attr('data-column') );
|
||||
} );
|
||||
} );
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body class="dt-example">
|
||||
<div class="container">
|
||||
<section>
|
||||
<h1>DataTables example <span>Search API (regular expressions)</span></h1>
|
||||
|
||||
<div class="info">
|
||||
<p>Searching a table is one of the most common user interactions with a DataTables table, and
|
||||
DataTables provides a number of methods for you to control this interaction. There are APIs for the
|
||||
global search (<a href="//datatables.net/reference/api/search()"><code class="api" title=
|
||||
"DataTables API method">search()<span>DT</span></code></a>) and for each individual column (<a href=
|
||||
"//datatables.net/reference/api/column().search()"><code class="api" title=
|
||||
"DataTables API method">column().search()<span>DT</span></code></a>).</p>
|
||||
|
||||
<p>Note also that you must call the <a href="//datatables.net/reference/api/draw()"><code class="api"
|
||||
title="DataTables API method">draw()<span>DT</span></code></a> method after performing the search, in
|
||||
order for the results to be displayed.</p>
|
||||
|
||||
<p>Each search (global or column) can be marked as a regular expression (allowing you to create very
|
||||
complex interactions) and as a smart search or not. When smart searching is enabled on a particular
|
||||
search, DataTables will modify the user input string to a complex regular expression which can make
|
||||
searching more intuitive.</p>
|
||||
|
||||
<p>This example allows you to "play" with the various searching options that DataTables provides.</p>
|
||||
</div>
|
||||
|
||||
<table cellpadding="3" cellspacing="0" border="0" style="width: 67%; margin: 0 auto 2em auto;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Target</th>
|
||||
<th>Search text</th>
|
||||
<th>Treat as regex</th>
|
||||
<th>Use smart search</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr id="filter_global">
|
||||
<td>Global search</td>
|
||||
<td align="center"><input type="text" class="global_filter" id="global_filter"></td>
|
||||
<td align="center"><input type="checkbox" class="global_filter" id="global_regex"></td>
|
||||
<td align="center"><input type="checkbox" class="global_filter" id="global_smart" checked=
|
||||
"checked"></td>
|
||||
</tr>
|
||||
<tr id="filter_col1" data-column="0">
|
||||
<td>Column - Name</td>
|
||||
<td align="center"><input type="text" class="column_filter" id="col0_filter"></td>
|
||||
<td align="center"><input type="checkbox" class="column_filter" id="col0_regex"></td>
|
||||
<td align="center"><input type="checkbox" class="column_filter" id="col0_smart" checked=
|
||||
"checked"></td>
|
||||
</tr>
|
||||
<tr id="filter_col2" data-column="1">
|
||||
<td>Column - Position</td>
|
||||
<td align="center"><input type="text" class="column_filter" id="col1_filter"></td>
|
||||
<td align="center"><input type="checkbox" class="column_filter" id="col1_regex"></td>
|
||||
<td align="center"><input type="checkbox" class="column_filter" id="col1_smart" checked=
|
||||
"checked"></td>
|
||||
</tr>
|
||||
<tr id="filter_col3" data-column="2">
|
||||
<td>Column - Office</td>
|
||||
<td align="center"><input type="text" class="column_filter" id="col2_filter"></td>
|
||||
<td align="center"><input type="checkbox" class="column_filter" id="col2_regex"></td>
|
||||
<td align="center"><input type="checkbox" class="column_filter" id="col2_smart" checked=
|
||||
"checked"></td>
|
||||
</tr>
|
||||
<tr id="filter_col4" data-column="3">
|
||||
<td>Column - Age</td>
|
||||
<td align="center"><input type="text" class="column_filter" id="col3_filter"></td>
|
||||
<td align="center"><input type="checkbox" class="column_filter" id="col3_regex"></td>
|
||||
<td align="center"><input type="checkbox" class="column_filter" id="col3_smart" checked=
|
||||
"checked"></td>
|
||||
</tr>
|
||||
<tr id="filter_col5" data-column="4">
|
||||
<td>Column - Start date</td>
|
||||
<td align="center"><input type="text" class="column_filter" id="col4_filter"></td>
|
||||
<td align="center"><input type="checkbox" class="column_filter" id="col4_regex"></td>
|
||||
<td align="center"><input type="checkbox" class="column_filter" id="col4_smart" checked=
|
||||
"checked"></td>
|
||||
</tr>
|
||||
<tr id="filter_col6" data-column="5">
|
||||
<td>Column - Salary</td>
|
||||
<td align="center"><input type="text" class="column_filter" id="col5_filter"></td>
|
||||
<td align="center"><input type="checkbox" class="column_filter" id="col5_regex"></td>
|
||||
<td align="center"><input type="checkbox" class="column_filter" id="col5_smart" checked=
|
||||
"checked"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table id="example" class="display" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Position</th>
|
||||
<th>Office</th>
|
||||
<th>Age</th>
|
||||
<th>Start date</th>
|
||||
<th>Salary</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Position</th>
|
||||
<th>Office</th>
|
||||
<th>Age</th>
|
||||
<th>Start date</th>
|
||||
<th>Salary</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Tiger Nixon</td>
|
||||
<td>System Architect</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>61</td>
|
||||
<td>2011/04/25</td>
|
||||
<td>$320,800</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Garrett Winters</td>
|
||||
<td>Accountant</td>
|
||||
<td>Tokyo</td>
|
||||
<td>63</td>
|
||||
<td>2011/07/25</td>
|
||||
<td>$170,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Ashton Cox</td>
|
||||
<td>Junior Technical Author</td>
|
||||
<td>San Francisco</td>
|
||||
<td>66</td>
|
||||
<td>2009/01/12</td>
|
||||
<td>$86,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cedric Kelly</td>
|
||||
<td>Senior Javascript Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>22</td>
|
||||
<td>2012/03/29</td>
|
||||
<td>$433,060</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Airi Satou</td>
|
||||
<td>Accountant</td>
|
||||
<td>Tokyo</td>
|
||||
<td>33</td>
|
||||
<td>2008/11/28</td>
|
||||
<td>$162,700</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Brielle Williamson</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>New York</td>
|
||||
<td>61</td>
|
||||
<td>2012/12/02</td>
|
||||
<td>$372,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Herrod Chandler</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>San Francisco</td>
|
||||
<td>59</td>
|
||||
<td>2012/08/06</td>
|
||||
<td>$137,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Rhona Davidson</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>Tokyo</td>
|
||||
<td>55</td>
|
||||
<td>2010/10/14</td>
|
||||
<td>$327,900</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Colleen Hurst</td>
|
||||
<td>Javascript Developer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>39</td>
|
||||
<td>2009/09/15</td>
|
||||
<td>$205,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sonya Frost</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>23</td>
|
||||
<td>2008/12/13</td>
|
||||
<td>$103,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jena Gaines</td>
|
||||
<td>Office Manager</td>
|
||||
<td>London</td>
|
||||
<td>30</td>
|
||||
<td>2008/12/19</td>
|
||||
<td>$90,560</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Quinn Flynn</td>
|
||||
<td>Support Lead</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>22</td>
|
||||
<td>2013/03/03</td>
|
||||
<td>$342,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Charde Marshall</td>
|
||||
<td>Regional Director</td>
|
||||
<td>San Francisco</td>
|
||||
<td>36</td>
|
||||
<td>2008/10/16</td>
|
||||
<td>$470,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Haley Kennedy</td>
|
||||
<td>Senior Marketing Designer</td>
|
||||
<td>London</td>
|
||||
<td>43</td>
|
||||
<td>2012/12/18</td>
|
||||
<td>$313,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Tatyana Fitzpatrick</td>
|
||||
<td>Regional Director</td>
|
||||
<td>London</td>
|
||||
<td>19</td>
|
||||
<td>2010/03/17</td>
|
||||
<td>$385,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Michael Silva</td>
|
||||
<td>Marketing Designer</td>
|
||||
<td>London</td>
|
||||
<td>66</td>
|
||||
<td>2012/11/27</td>
|
||||
<td>$198,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Paul Byrd</td>
|
||||
<td>Chief Financial Officer (CFO)</td>
|
||||
<td>New York</td>
|
||||
<td>64</td>
|
||||
<td>2010/06/09</td>
|
||||
<td>$725,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gloria Little</td>
|
||||
<td>Systems Administrator</td>
|
||||
<td>New York</td>
|
||||
<td>59</td>
|
||||
<td>2009/04/10</td>
|
||||
<td>$237,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bradley Greer</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>London</td>
|
||||
<td>41</td>
|
||||
<td>2012/10/13</td>
|
||||
<td>$132,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Dai Rios</td>
|
||||
<td>Personnel Lead</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>35</td>
|
||||
<td>2012/09/26</td>
|
||||
<td>$217,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jenette Caldwell</td>
|
||||
<td>Development Lead</td>
|
||||
<td>New York</td>
|
||||
<td>30</td>
|
||||
<td>2011/09/03</td>
|
||||
<td>$345,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Yuri Berry</td>
|
||||
<td>Chief Marketing Officer (CMO)</td>
|
||||
<td>New York</td>
|
||||
<td>40</td>
|
||||
<td>2009/06/25</td>
|
||||
<td>$675,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Caesar Vance</td>
|
||||
<td>Pre-Sales Support</td>
|
||||
<td>New York</td>
|
||||
<td>21</td>
|
||||
<td>2011/12/12</td>
|
||||
<td>$106,450</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Doris Wilder</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>Sidney</td>
|
||||
<td>23</td>
|
||||
<td>2010/09/20</td>
|
||||
<td>$85,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Angelica Ramos</td>
|
||||
<td>Chief Executive Officer (CEO)</td>
|
||||
<td>London</td>
|
||||
<td>47</td>
|
||||
<td>2009/10/09</td>
|
||||
<td>$1,200,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gavin Joyce</td>
|
||||
<td>Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>42</td>
|
||||
<td>2010/12/22</td>
|
||||
<td>$92,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jennifer Chang</td>
|
||||
<td>Regional Director</td>
|
||||
<td>Singapore</td>
|
||||
<td>28</td>
|
||||
<td>2010/11/14</td>
|
||||
<td>$357,650</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Brenden Wagner</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>28</td>
|
||||
<td>2011/06/07</td>
|
||||
<td>$206,850</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fiona Green</td>
|
||||
<td>Chief Operating Officer (COO)</td>
|
||||
<td>San Francisco</td>
|
||||
<td>48</td>
|
||||
<td>2010/03/11</td>
|
||||
<td>$850,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Shou Itou</td>
|
||||
<td>Regional Marketing</td>
|
||||
<td>Tokyo</td>
|
||||
<td>20</td>
|
||||
<td>2011/08/14</td>
|
||||
<td>$163,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Michelle House</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>Sidney</td>
|
||||
<td>37</td>
|
||||
<td>2011/06/02</td>
|
||||
<td>$95,400</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Suki Burks</td>
|
||||
<td>Developer</td>
|
||||
<td>London</td>
|
||||
<td>53</td>
|
||||
<td>2009/10/22</td>
|
||||
<td>$114,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Prescott Bartlett</td>
|
||||
<td>Technical Author</td>
|
||||
<td>London</td>
|
||||
<td>27</td>
|
||||
<td>2011/05/07</td>
|
||||
<td>$145,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gavin Cortez</td>
|
||||
<td>Team Leader</td>
|
||||
<td>San Francisco</td>
|
||||
<td>22</td>
|
||||
<td>2008/10/26</td>
|
||||
<td>$235,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Martena Mccray</td>
|
||||
<td>Post-Sales support</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>46</td>
|
||||
<td>2011/03/09</td>
|
||||
<td>$324,050</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Unity Butler</td>
|
||||
<td>Marketing Designer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>47</td>
|
||||
<td>2009/12/09</td>
|
||||
<td>$85,675</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Howard Hatfield</td>
|
||||
<td>Office Manager</td>
|
||||
<td>San Francisco</td>
|
||||
<td>51</td>
|
||||
<td>2008/12/16</td>
|
||||
<td>$164,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hope Fuentes</td>
|
||||
<td>Secretary</td>
|
||||
<td>San Francisco</td>
|
||||
<td>41</td>
|
||||
<td>2010/02/12</td>
|
||||
<td>$109,850</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Vivian Harrell</td>
|
||||
<td>Financial Controller</td>
|
||||
<td>San Francisco</td>
|
||||
<td>62</td>
|
||||
<td>2009/02/14</td>
|
||||
<td>$452,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Timothy Mooney</td>
|
||||
<td>Office Manager</td>
|
||||
<td>London</td>
|
||||
<td>37</td>
|
||||
<td>2008/12/11</td>
|
||||
<td>$136,200</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jackson Bradshaw</td>
|
||||
<td>Director</td>
|
||||
<td>New York</td>
|
||||
<td>65</td>
|
||||
<td>2008/09/26</td>
|
||||
<td>$645,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Olivia Liang</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>Singapore</td>
|
||||
<td>64</td>
|
||||
<td>2011/02/03</td>
|
||||
<td>$234,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruno Nash</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>London</td>
|
||||
<td>38</td>
|
||||
<td>2011/05/03</td>
|
||||
<td>$163,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sakura Yamamoto</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>Tokyo</td>
|
||||
<td>37</td>
|
||||
<td>2009/08/19</td>
|
||||
<td>$139,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Thor Walton</td>
|
||||
<td>Developer</td>
|
||||
<td>New York</td>
|
||||
<td>61</td>
|
||||
<td>2013/08/11</td>
|
||||
<td>$98,540</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Finn Camacho</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>47</td>
|
||||
<td>2009/07/07</td>
|
||||
<td>$87,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Serge Baldwin</td>
|
||||
<td>Data Coordinator</td>
|
||||
<td>Singapore</td>
|
||||
<td>64</td>
|
||||
<td>2012/04/09</td>
|
||||
<td>$138,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Zenaida Frank</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>New York</td>
|
||||
<td>63</td>
|
||||
<td>2010/01/04</td>
|
||||
<td>$125,250</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Zorita Serrano</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>56</td>
|
||||
<td>2012/06/01</td>
|
||||
<td>$115,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jennifer Acosta</td>
|
||||
<td>Junior Javascript Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>43</td>
|
||||
<td>2013/02/01</td>
|
||||
<td>$75,650</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cara Stevens</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>New York</td>
|
||||
<td>46</td>
|
||||
<td>2011/12/06</td>
|
||||
<td>$145,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hermione Butler</td>
|
||||
<td>Regional Director</td>
|
||||
<td>London</td>
|
||||
<td>47</td>
|
||||
<td>2011/03/21</td>
|
||||
<td>$356,250</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Lael Greer</td>
|
||||
<td>Systems Administrator</td>
|
||||
<td>London</td>
|
||||
<td>21</td>
|
||||
<td>2009/02/27</td>
|
||||
<td>$103,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jonas Alexander</td>
|
||||
<td>Developer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>30</td>
|
||||
<td>2010/07/14</td>
|
||||
<td>$86,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Shad Decker</td>
|
||||
<td>Regional Director</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>51</td>
|
||||
<td>2008/11/13</td>
|
||||
<td>$183,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Michael Bruce</td>
|
||||
<td>Javascript Developer</td>
|
||||
<td>Singapore</td>
|
||||
<td>29</td>
|
||||
<td>2011/06/27</td>
|
||||
<td>$183,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Donna Snider</td>
|
||||
<td>Customer Support</td>
|
||||
<td>New York</td>
|
||||
<td>27</td>
|
||||
<td>2011/01/25</td>
|
||||
<td>$112,000</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 brush: js;">function filterGlobal () {
|
||||
$('#example').DataTable().search(
|
||||
$('#global_filter').val(),
|
||||
$('#global_regex').prop('checked'),
|
||||
$('#global_smart').prop('checked')
|
||||
).draw();
|
||||
}
|
||||
|
||||
function filterColumn ( i ) {
|
||||
$('#example').DataTable().column( i ).search(
|
||||
$('#col'+i+'_filter').val(),
|
||||
$('#col'+i+'_regex').prop('checked'),
|
||||
$('#col'+i+'_smart').prop('checked')
|
||||
).draw();
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#example').dataTable();
|
||||
|
||||
$('input.global_filter').on( 'keyup click', function () {
|
||||
filterGlobal();
|
||||
} );
|
||||
|
||||
$('input.column_filter').on( 'keyup click', function () {
|
||||
filterColumn( $(this).parents('tr').attr('data-column') );
|
||||
} );
|
||||
} );</code>
|
||||
|
||||
<p>In addition to the above code, the following Javascript library files are loaded for use in this
|
||||
example:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="../../media/js/jquery.js">../../media/js/jquery.js</a></li>
|
||||
<li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="table">
|
||||
<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 brush: js;"></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>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<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_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/scroll_y_theme.html">Scroll - vertical with jQuery UI
|
||||
ThemeRoller</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 (rowspan /
|
||||
colspan)</a></li>
|
||||
<li><a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes</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</a></li>
|
||||
<li><a href="../styling/foundation.html">Foundation</a></li>
|
||||
<li><a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</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><a href="./tabs_and_scrolling.html">Scrolling and jQuery UI tabs</a></li>
|
||||
<li class="active"><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/extras">extras</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-2014<br>
|
||||
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,415 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<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">
|
||||
|
||||
<title>DataTables example - Child rows (show extra / detailed information)</title>
|
||||
<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">
|
||||
|
||||
td.details-control {
|
||||
background: url('../resources/details_open.png') no-repeat center center;
|
||||
cursor: pointer;
|
||||
}
|
||||
tr.shown td.details-control {
|
||||
background: url('../resources/details_close.png') no-repeat center center;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script type="text/javascript" language="javascript" src="../../media/js/jquery.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 type="text/javascript" language="javascript" class="init">
|
||||
|
||||
|
||||
/* Formatting function for row details - modify as you need */
|
||||
function format ( d ) {
|
||||
// `d` is the original data object for the row
|
||||
return '<table cellpadding="5" cellspacing="0" border="0" style="padding-left:50px;">'+
|
||||
'<tr>'+
|
||||
'<td>Full name:</td>'+
|
||||
'<td>'+d.name+'</td>'+
|
||||
'</tr>'+
|
||||
'<tr>'+
|
||||
'<td>Extension number:</td>'+
|
||||
'<td>'+d.extn+'</td>'+
|
||||
'</tr>'+
|
||||
'<tr>'+
|
||||
'<td>Extra info:</td>'+
|
||||
'<td>And any further details here (images etc)...</td>'+
|
||||
'</tr>'+
|
||||
'</table>';
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
var table = $('#example').DataTable( {
|
||||
"ajax": "../ajax/data/objects.txt",
|
||||
"columns": [
|
||||
{
|
||||
"class": 'details-control',
|
||||
"orderable": false,
|
||||
"data": null,
|
||||
"defaultContent": ''
|
||||
},
|
||||
{ "data": "name" },
|
||||
{ "data": "position" },
|
||||
{ "data": "office" },
|
||||
{ "data": "salary" }
|
||||
],
|
||||
"order": [[1, 'asc']]
|
||||
} );
|
||||
|
||||
// Add event listener for opening and closing details
|
||||
$('#example tbody').on('click', 'td.details-control', function () {
|
||||
var tr = $(this).closest('tr');
|
||||
var row = table.row( tr );
|
||||
|
||||
if ( row.child.isShown() ) {
|
||||
// This row is already open - close it
|
||||
row.child.hide();
|
||||
tr.removeClass('shown');
|
||||
}
|
||||
else {
|
||||
// Open this row
|
||||
row.child( format(row.data()) ).show();
|
||||
tr.addClass('shown');
|
||||
}
|
||||
} );
|
||||
} );
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body class="dt-example">
|
||||
<div class="container">
|
||||
<section>
|
||||
<h1>DataTables example <span>Child rows (show extra / detailed information)</span></h1>
|
||||
|
||||
<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 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<span>DT</span></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()<span>DT</span></code></a>), otherwise show it (<a href=
|
||||
"//datatables.net/reference/api/row().child.show()"><code class="api" title=
|
||||
"DataTables API method">row().child.show()<span>DT</span></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>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
<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 brush: js;">/* Formatting function for row details - modify as you need */
|
||||
function format ( d ) {
|
||||
// `d` is the original data object for the row
|
||||
return '<table cellpadding="5" cellspacing="0" border="0" style="padding-left:50px;">'+
|
||||
'<tr>'+
|
||||
'<td>Full name:</td>'+
|
||||
'<td>'+d.name+'</td>'+
|
||||
'</tr>'+
|
||||
'<tr>'+
|
||||
'<td>Extension number:</td>'+
|
||||
'<td>'+d.extn+'</td>'+
|
||||
'</tr>'+
|
||||
'<tr>'+
|
||||
'<td>Extra info:</td>'+
|
||||
'<td>And any further details here (images etc)...</td>'+
|
||||
'</tr>'+
|
||||
'</table>';
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
var table = $('#example').DataTable( {
|
||||
"ajax": "../ajax/data/objects.txt",
|
||||
"columns": [
|
||||
{
|
||||
"class": 'details-control',
|
||||
"orderable": false,
|
||||
"data": null,
|
||||
"defaultContent": ''
|
||||
},
|
||||
{ "data": "name" },
|
||||
{ "data": "position" },
|
||||
{ "data": "office" },
|
||||
{ "data": "salary" }
|
||||
],
|
||||
"order": [[1, 'asc']]
|
||||
} );
|
||||
|
||||
// Add event listener for opening and closing details
|
||||
$('#example tbody').on('click', 'td.details-control', function () {
|
||||
var tr = $(this).closest('tr');
|
||||
var row = table.row( tr );
|
||||
|
||||
if ( row.child.isShown() ) {
|
||||
// This row is already open - close it
|
||||
row.child.hide();
|
||||
tr.removeClass('shown');
|
||||
}
|
||||
else {
|
||||
// Open this row
|
||||
row.child( format(row.data()) ).show();
|
||||
tr.addClass('shown');
|
||||
}
|
||||
} );
|
||||
} );</code>
|
||||
|
||||
<p>In addition to the above code, the following Javascript library files are loaded for use in this
|
||||
example:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="../../media/js/jquery.js">../../media/js/jquery.js</a></li>
|
||||
<li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="table">
|
||||
<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 brush: js;">td.details-control {
|
||||
background: url('../resources/details_open.png') no-repeat center center;
|
||||
cursor: pointer;
|
||||
}
|
||||
tr.shown td.details-control {
|
||||
background: url('../resources/details_close.png') no-repeat center center;
|
||||
}</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>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<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_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/scroll_y_theme.html">Scroll - vertical with jQuery UI
|
||||
ThemeRoller</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 (rowspan /
|
||||
colspan)</a></li>
|
||||
<li><a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes</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</a></li>
|
||||
<li><a href="../styling/foundation.html">Foundation</a></li>
|
||||
<li><a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</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 jQuery UI 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/extras">extras</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-2014<br>
|
||||
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,771 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<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">
|
||||
|
||||
<title>DataTables example - Row selection (multiple rows)</title>
|
||||
<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>
|
||||
<script type="text/javascript" language="javascript" src="../../media/js/jquery.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 type="text/javascript" language="javascript" class="init">
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
var table = $('#example').DataTable();
|
||||
|
||||
$('#example tbody').on( 'click', 'tr', function () {
|
||||
$(this).toggleClass('selected');
|
||||
} );
|
||||
|
||||
$('#button').click( function () {
|
||||
alert( table.rows('.selected').data().length +' row(s) selected' );
|
||||
} );
|
||||
} );
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body class="dt-example">
|
||||
<div class="container">
|
||||
<section>
|
||||
<h1>DataTables example <span>Row selection (multiple rows)</span></h1>
|
||||
|
||||
<div class="info">
|
||||
<p>It can be quite useful at times to provide the user with the option to select rows in a DataTable.
|
||||
This can be done by simply using a click event to add / remove a class on the table rows. The <a href=
|
||||
"//datatables.net/reference/api/rows().data()"><code class="api" title=
|
||||
"DataTables API method">rows().data()<span>DT</span></code></a> method can then be used to get the data
|
||||
for the selected rows. In this case it is simply counting the number of selected rows, but much more
|
||||
complex interactions can easily be developed.</p>
|
||||
|
||||
<p>If you are looking for a more complete row selection option <a href=
|
||||
"http://datatables.net/extras/tabletools">TableTools for DataTables</a> provides a complete API for
|
||||
selecting rows and acting upon those selected rows.</p>
|
||||
</div><button id="button">Row count</button>
|
||||
|
||||
<table id="example" class="display" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Position</th>
|
||||
<th>Office</th>
|
||||
<th>Age</th>
|
||||
<th>Start date</th>
|
||||
<th>Salary</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Position</th>
|
||||
<th>Office</th>
|
||||
<th>Age</th>
|
||||
<th>Start date</th>
|
||||
<th>Salary</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Tiger Nixon</td>
|
||||
<td>System Architect</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>61</td>
|
||||
<td>2011/04/25</td>
|
||||
<td>$320,800</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Garrett Winters</td>
|
||||
<td>Accountant</td>
|
||||
<td>Tokyo</td>
|
||||
<td>63</td>
|
||||
<td>2011/07/25</td>
|
||||
<td>$170,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Ashton Cox</td>
|
||||
<td>Junior Technical Author</td>
|
||||
<td>San Francisco</td>
|
||||
<td>66</td>
|
||||
<td>2009/01/12</td>
|
||||
<td>$86,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cedric Kelly</td>
|
||||
<td>Senior Javascript Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>22</td>
|
||||
<td>2012/03/29</td>
|
||||
<td>$433,060</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Airi Satou</td>
|
||||
<td>Accountant</td>
|
||||
<td>Tokyo</td>
|
||||
<td>33</td>
|
||||
<td>2008/11/28</td>
|
||||
<td>$162,700</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Brielle Williamson</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>New York</td>
|
||||
<td>61</td>
|
||||
<td>2012/12/02</td>
|
||||
<td>$372,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Herrod Chandler</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>San Francisco</td>
|
||||
<td>59</td>
|
||||
<td>2012/08/06</td>
|
||||
<td>$137,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Rhona Davidson</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>Tokyo</td>
|
||||
<td>55</td>
|
||||
<td>2010/10/14</td>
|
||||
<td>$327,900</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Colleen Hurst</td>
|
||||
<td>Javascript Developer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>39</td>
|
||||
<td>2009/09/15</td>
|
||||
<td>$205,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sonya Frost</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>23</td>
|
||||
<td>2008/12/13</td>
|
||||
<td>$103,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jena Gaines</td>
|
||||
<td>Office Manager</td>
|
||||
<td>London</td>
|
||||
<td>30</td>
|
||||
<td>2008/12/19</td>
|
||||
<td>$90,560</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Quinn Flynn</td>
|
||||
<td>Support Lead</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>22</td>
|
||||
<td>2013/03/03</td>
|
||||
<td>$342,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Charde Marshall</td>
|
||||
<td>Regional Director</td>
|
||||
<td>San Francisco</td>
|
||||
<td>36</td>
|
||||
<td>2008/10/16</td>
|
||||
<td>$470,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Haley Kennedy</td>
|
||||
<td>Senior Marketing Designer</td>
|
||||
<td>London</td>
|
||||
<td>43</td>
|
||||
<td>2012/12/18</td>
|
||||
<td>$313,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Tatyana Fitzpatrick</td>
|
||||
<td>Regional Director</td>
|
||||
<td>London</td>
|
||||
<td>19</td>
|
||||
<td>2010/03/17</td>
|
||||
<td>$385,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Michael Silva</td>
|
||||
<td>Marketing Designer</td>
|
||||
<td>London</td>
|
||||
<td>66</td>
|
||||
<td>2012/11/27</td>
|
||||
<td>$198,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Paul Byrd</td>
|
||||
<td>Chief Financial Officer (CFO)</td>
|
||||
<td>New York</td>
|
||||
<td>64</td>
|
||||
<td>2010/06/09</td>
|
||||
<td>$725,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gloria Little</td>
|
||||
<td>Systems Administrator</td>
|
||||
<td>New York</td>
|
||||
<td>59</td>
|
||||
<td>2009/04/10</td>
|
||||
<td>$237,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bradley Greer</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>London</td>
|
||||
<td>41</td>
|
||||
<td>2012/10/13</td>
|
||||
<td>$132,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Dai Rios</td>
|
||||
<td>Personnel Lead</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>35</td>
|
||||
<td>2012/09/26</td>
|
||||
<td>$217,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jenette Caldwell</td>
|
||||
<td>Development Lead</td>
|
||||
<td>New York</td>
|
||||
<td>30</td>
|
||||
<td>2011/09/03</td>
|
||||
<td>$345,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Yuri Berry</td>
|
||||
<td>Chief Marketing Officer (CMO)</td>
|
||||
<td>New York</td>
|
||||
<td>40</td>
|
||||
<td>2009/06/25</td>
|
||||
<td>$675,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Caesar Vance</td>
|
||||
<td>Pre-Sales Support</td>
|
||||
<td>New York</td>
|
||||
<td>21</td>
|
||||
<td>2011/12/12</td>
|
||||
<td>$106,450</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Doris Wilder</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>Sidney</td>
|
||||
<td>23</td>
|
||||
<td>2010/09/20</td>
|
||||
<td>$85,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Angelica Ramos</td>
|
||||
<td>Chief Executive Officer (CEO)</td>
|
||||
<td>London</td>
|
||||
<td>47</td>
|
||||
<td>2009/10/09</td>
|
||||
<td>$1,200,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gavin Joyce</td>
|
||||
<td>Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>42</td>
|
||||
<td>2010/12/22</td>
|
||||
<td>$92,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jennifer Chang</td>
|
||||
<td>Regional Director</td>
|
||||
<td>Singapore</td>
|
||||
<td>28</td>
|
||||
<td>2010/11/14</td>
|
||||
<td>$357,650</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Brenden Wagner</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>28</td>
|
||||
<td>2011/06/07</td>
|
||||
<td>$206,850</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fiona Green</td>
|
||||
<td>Chief Operating Officer (COO)</td>
|
||||
<td>San Francisco</td>
|
||||
<td>48</td>
|
||||
<td>2010/03/11</td>
|
||||
<td>$850,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Shou Itou</td>
|
||||
<td>Regional Marketing</td>
|
||||
<td>Tokyo</td>
|
||||
<td>20</td>
|
||||
<td>2011/08/14</td>
|
||||
<td>$163,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Michelle House</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>Sidney</td>
|
||||
<td>37</td>
|
||||
<td>2011/06/02</td>
|
||||
<td>$95,400</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Suki Burks</td>
|
||||
<td>Developer</td>
|
||||
<td>London</td>
|
||||
<td>53</td>
|
||||
<td>2009/10/22</td>
|
||||
<td>$114,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Prescott Bartlett</td>
|
||||
<td>Technical Author</td>
|
||||
<td>London</td>
|
||||
<td>27</td>
|
||||
<td>2011/05/07</td>
|
||||
<td>$145,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gavin Cortez</td>
|
||||
<td>Team Leader</td>
|
||||
<td>San Francisco</td>
|
||||
<td>22</td>
|
||||
<td>2008/10/26</td>
|
||||
<td>$235,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Martena Mccray</td>
|
||||
<td>Post-Sales support</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>46</td>
|
||||
<td>2011/03/09</td>
|
||||
<td>$324,050</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Unity Butler</td>
|
||||
<td>Marketing Designer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>47</td>
|
||||
<td>2009/12/09</td>
|
||||
<td>$85,675</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Howard Hatfield</td>
|
||||
<td>Office Manager</td>
|
||||
<td>San Francisco</td>
|
||||
<td>51</td>
|
||||
<td>2008/12/16</td>
|
||||
<td>$164,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hope Fuentes</td>
|
||||
<td>Secretary</td>
|
||||
<td>San Francisco</td>
|
||||
<td>41</td>
|
||||
<td>2010/02/12</td>
|
||||
<td>$109,850</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Vivian Harrell</td>
|
||||
<td>Financial Controller</td>
|
||||
<td>San Francisco</td>
|
||||
<td>62</td>
|
||||
<td>2009/02/14</td>
|
||||
<td>$452,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Timothy Mooney</td>
|
||||
<td>Office Manager</td>
|
||||
<td>London</td>
|
||||
<td>37</td>
|
||||
<td>2008/12/11</td>
|
||||
<td>$136,200</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jackson Bradshaw</td>
|
||||
<td>Director</td>
|
||||
<td>New York</td>
|
||||
<td>65</td>
|
||||
<td>2008/09/26</td>
|
||||
<td>$645,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Olivia Liang</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>Singapore</td>
|
||||
<td>64</td>
|
||||
<td>2011/02/03</td>
|
||||
<td>$234,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruno Nash</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>London</td>
|
||||
<td>38</td>
|
||||
<td>2011/05/03</td>
|
||||
<td>$163,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sakura Yamamoto</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>Tokyo</td>
|
||||
<td>37</td>
|
||||
<td>2009/08/19</td>
|
||||
<td>$139,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Thor Walton</td>
|
||||
<td>Developer</td>
|
||||
<td>New York</td>
|
||||
<td>61</td>
|
||||
<td>2013/08/11</td>
|
||||
<td>$98,540</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Finn Camacho</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>47</td>
|
||||
<td>2009/07/07</td>
|
||||
<td>$87,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Serge Baldwin</td>
|
||||
<td>Data Coordinator</td>
|
||||
<td>Singapore</td>
|
||||
<td>64</td>
|
||||
<td>2012/04/09</td>
|
||||
<td>$138,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Zenaida Frank</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>New York</td>
|
||||
<td>63</td>
|
||||
<td>2010/01/04</td>
|
||||
<td>$125,250</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Zorita Serrano</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>56</td>
|
||||
<td>2012/06/01</td>
|
||||
<td>$115,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jennifer Acosta</td>
|
||||
<td>Junior Javascript Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>43</td>
|
||||
<td>2013/02/01</td>
|
||||
<td>$75,650</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cara Stevens</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>New York</td>
|
||||
<td>46</td>
|
||||
<td>2011/12/06</td>
|
||||
<td>$145,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hermione Butler</td>
|
||||
<td>Regional Director</td>
|
||||
<td>London</td>
|
||||
<td>47</td>
|
||||
<td>2011/03/21</td>
|
||||
<td>$356,250</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Lael Greer</td>
|
||||
<td>Systems Administrator</td>
|
||||
<td>London</td>
|
||||
<td>21</td>
|
||||
<td>2009/02/27</td>
|
||||
<td>$103,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jonas Alexander</td>
|
||||
<td>Developer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>30</td>
|
||||
<td>2010/07/14</td>
|
||||
<td>$86,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Shad Decker</td>
|
||||
<td>Regional Director</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>51</td>
|
||||
<td>2008/11/13</td>
|
||||
<td>$183,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Michael Bruce</td>
|
||||
<td>Javascript Developer</td>
|
||||
<td>Singapore</td>
|
||||
<td>29</td>
|
||||
<td>2011/06/27</td>
|
||||
<td>$183,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Donna Snider</td>
|
||||
<td>Customer Support</td>
|
||||
<td>New York</td>
|
||||
<td>27</td>
|
||||
<td>2011/01/25</td>
|
||||
<td>$112,000</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 brush: js;">$(document).ready(function() {
|
||||
var table = $('#example').DataTable();
|
||||
|
||||
$('#example tbody').on( 'click', 'tr', function () {
|
||||
$(this).toggleClass('selected');
|
||||
} );
|
||||
|
||||
$('#button').click( function () {
|
||||
alert( table.rows('.selected').data().length +' row(s) selected' );
|
||||
} );
|
||||
} );</code>
|
||||
|
||||
<p>In addition to the above code, the following Javascript library files are loaded for use in this
|
||||
example:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="../../media/js/jquery.js">../../media/js/jquery.js</a></li>
|
||||
<li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="table">
|
||||
<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 brush: js;"></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>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<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_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/scroll_y_theme.html">Scroll - vertical with jQuery UI
|
||||
ThemeRoller</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 (rowspan /
|
||||
colspan)</a></li>
|
||||
<li><a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes</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</a></li>
|
||||
<li><a href="../styling/foundation.html">Foundation</a></li>
|
||||
<li><a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</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 class="active"><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 jQuery UI 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/extras">extras</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-2014<br>
|
||||
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,789 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<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">
|
||||
|
||||
<title>DataTables example - Row selection and deletion (single row)</title>
|
||||
<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>
|
||||
<script type="text/javascript" language="javascript" src="../../media/js/jquery.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 type="text/javascript" language="javascript" class="init">
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
var table = $('#example').DataTable();
|
||||
|
||||
$('#example tbody').on( 'click', 'tr', function () {
|
||||
if ( $(this).hasClass('selected') ) {
|
||||
$(this).removeClass('selected');
|
||||
}
|
||||
else {
|
||||
table.$('tr.selected').removeClass('selected');
|
||||
$(this).addClass('selected');
|
||||
}
|
||||
} );
|
||||
|
||||
$('#button').click( function () {
|
||||
table.row('.selected').remove().draw( false );
|
||||
} );
|
||||
} );
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body class="dt-example">
|
||||
<div class="container">
|
||||
<section>
|
||||
<h1>DataTables example <span>Row selection and deletion (single row)</span></h1>
|
||||
|
||||
<div class="info">
|
||||
<p>This example shows a modification of the multiple row selection example, where just a single can now
|
||||
be selected. This is done simply by checking to see if the row already has a selected class or not, and
|
||||
if so removing it, if not then the class is removed from any other row in the table which does have it
|
||||
and applied to the row to be selected.</p>
|
||||
|
||||
<p>Also shown is the <a href="//datatables.net/reference/api/row().remove()"><code class="api" title=
|
||||
"DataTables API method">row().remove()<span>DT</span></code></a> method which will delete a row from a
|
||||
table, and the <a href="//datatables.net/reference/api/draw()"><code class="api" title=
|
||||
"DataTables API method">draw()<span>DT</span></code></a> method with <code>false</code> as its first
|
||||
parameter. This will redraw the table keeping the current paging (without the <code>false</code>
|
||||
parameter the paging would be reset to the first page).</p>
|
||||
|
||||
<p>If you are looking for a more complete row selection option <a href=
|
||||
"http://datatables.net/extras/tabletools">TableTools for DataTables</a> provides a complete API for
|
||||
selecting rows and acting upon those selected rows.</p>
|
||||
</div><button id="button">Delete selected row</button>
|
||||
|
||||
<table id="example" class="display" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Position</th>
|
||||
<th>Office</th>
|
||||
<th>Age</th>
|
||||
<th>Start date</th>
|
||||
<th>Salary</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Position</th>
|
||||
<th>Office</th>
|
||||
<th>Age</th>
|
||||
<th>Start date</th>
|
||||
<th>Salary</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Tiger Nixon</td>
|
||||
<td>System Architect</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>61</td>
|
||||
<td>2011/04/25</td>
|
||||
<td>$320,800</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Garrett Winters</td>
|
||||
<td>Accountant</td>
|
||||
<td>Tokyo</td>
|
||||
<td>63</td>
|
||||
<td>2011/07/25</td>
|
||||
<td>$170,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Ashton Cox</td>
|
||||
<td>Junior Technical Author</td>
|
||||
<td>San Francisco</td>
|
||||
<td>66</td>
|
||||
<td>2009/01/12</td>
|
||||
<td>$86,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cedric Kelly</td>
|
||||
<td>Senior Javascript Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>22</td>
|
||||
<td>2012/03/29</td>
|
||||
<td>$433,060</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Airi Satou</td>
|
||||
<td>Accountant</td>
|
||||
<td>Tokyo</td>
|
||||
<td>33</td>
|
||||
<td>2008/11/28</td>
|
||||
<td>$162,700</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Brielle Williamson</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>New York</td>
|
||||
<td>61</td>
|
||||
<td>2012/12/02</td>
|
||||
<td>$372,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Herrod Chandler</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>San Francisco</td>
|
||||
<td>59</td>
|
||||
<td>2012/08/06</td>
|
||||
<td>$137,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Rhona Davidson</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>Tokyo</td>
|
||||
<td>55</td>
|
||||
<td>2010/10/14</td>
|
||||
<td>$327,900</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Colleen Hurst</td>
|
||||
<td>Javascript Developer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>39</td>
|
||||
<td>2009/09/15</td>
|
||||
<td>$205,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sonya Frost</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>23</td>
|
||||
<td>2008/12/13</td>
|
||||
<td>$103,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jena Gaines</td>
|
||||
<td>Office Manager</td>
|
||||
<td>London</td>
|
||||
<td>30</td>
|
||||
<td>2008/12/19</td>
|
||||
<td>$90,560</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Quinn Flynn</td>
|
||||
<td>Support Lead</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>22</td>
|
||||
<td>2013/03/03</td>
|
||||
<td>$342,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Charde Marshall</td>
|
||||
<td>Regional Director</td>
|
||||
<td>San Francisco</td>
|
||||
<td>36</td>
|
||||
<td>2008/10/16</td>
|
||||
<td>$470,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Haley Kennedy</td>
|
||||
<td>Senior Marketing Designer</td>
|
||||
<td>London</td>
|
||||
<td>43</td>
|
||||
<td>2012/12/18</td>
|
||||
<td>$313,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Tatyana Fitzpatrick</td>
|
||||
<td>Regional Director</td>
|
||||
<td>London</td>
|
||||
<td>19</td>
|
||||
<td>2010/03/17</td>
|
||||
<td>$385,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Michael Silva</td>
|
||||
<td>Marketing Designer</td>
|
||||
<td>London</td>
|
||||
<td>66</td>
|
||||
<td>2012/11/27</td>
|
||||
<td>$198,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Paul Byrd</td>
|
||||
<td>Chief Financial Officer (CFO)</td>
|
||||
<td>New York</td>
|
||||
<td>64</td>
|
||||
<td>2010/06/09</td>
|
||||
<td>$725,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gloria Little</td>
|
||||
<td>Systems Administrator</td>
|
||||
<td>New York</td>
|
||||
<td>59</td>
|
||||
<td>2009/04/10</td>
|
||||
<td>$237,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bradley Greer</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>London</td>
|
||||
<td>41</td>
|
||||
<td>2012/10/13</td>
|
||||
<td>$132,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Dai Rios</td>
|
||||
<td>Personnel Lead</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>35</td>
|
||||
<td>2012/09/26</td>
|
||||
<td>$217,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jenette Caldwell</td>
|
||||
<td>Development Lead</td>
|
||||
<td>New York</td>
|
||||
<td>30</td>
|
||||
<td>2011/09/03</td>
|
||||
<td>$345,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Yuri Berry</td>
|
||||
<td>Chief Marketing Officer (CMO)</td>
|
||||
<td>New York</td>
|
||||
<td>40</td>
|
||||
<td>2009/06/25</td>
|
||||
<td>$675,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Caesar Vance</td>
|
||||
<td>Pre-Sales Support</td>
|
||||
<td>New York</td>
|
||||
<td>21</td>
|
||||
<td>2011/12/12</td>
|
||||
<td>$106,450</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Doris Wilder</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>Sidney</td>
|
||||
<td>23</td>
|
||||
<td>2010/09/20</td>
|
||||
<td>$85,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Angelica Ramos</td>
|
||||
<td>Chief Executive Officer (CEO)</td>
|
||||
<td>London</td>
|
||||
<td>47</td>
|
||||
<td>2009/10/09</td>
|
||||
<td>$1,200,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gavin Joyce</td>
|
||||
<td>Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>42</td>
|
||||
<td>2010/12/22</td>
|
||||
<td>$92,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jennifer Chang</td>
|
||||
<td>Regional Director</td>
|
||||
<td>Singapore</td>
|
||||
<td>28</td>
|
||||
<td>2010/11/14</td>
|
||||
<td>$357,650</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Brenden Wagner</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>28</td>
|
||||
<td>2011/06/07</td>
|
||||
<td>$206,850</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fiona Green</td>
|
||||
<td>Chief Operating Officer (COO)</td>
|
||||
<td>San Francisco</td>
|
||||
<td>48</td>
|
||||
<td>2010/03/11</td>
|
||||
<td>$850,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Shou Itou</td>
|
||||
<td>Regional Marketing</td>
|
||||
<td>Tokyo</td>
|
||||
<td>20</td>
|
||||
<td>2011/08/14</td>
|
||||
<td>$163,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Michelle House</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>Sidney</td>
|
||||
<td>37</td>
|
||||
<td>2011/06/02</td>
|
||||
<td>$95,400</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Suki Burks</td>
|
||||
<td>Developer</td>
|
||||
<td>London</td>
|
||||
<td>53</td>
|
||||
<td>2009/10/22</td>
|
||||
<td>$114,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Prescott Bartlett</td>
|
||||
<td>Technical Author</td>
|
||||
<td>London</td>
|
||||
<td>27</td>
|
||||
<td>2011/05/07</td>
|
||||
<td>$145,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gavin Cortez</td>
|
||||
<td>Team Leader</td>
|
||||
<td>San Francisco</td>
|
||||
<td>22</td>
|
||||
<td>2008/10/26</td>
|
||||
<td>$235,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Martena Mccray</td>
|
||||
<td>Post-Sales support</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>46</td>
|
||||
<td>2011/03/09</td>
|
||||
<td>$324,050</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Unity Butler</td>
|
||||
<td>Marketing Designer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>47</td>
|
||||
<td>2009/12/09</td>
|
||||
<td>$85,675</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Howard Hatfield</td>
|
||||
<td>Office Manager</td>
|
||||
<td>San Francisco</td>
|
||||
<td>51</td>
|
||||
<td>2008/12/16</td>
|
||||
<td>$164,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hope Fuentes</td>
|
||||
<td>Secretary</td>
|
||||
<td>San Francisco</td>
|
||||
<td>41</td>
|
||||
<td>2010/02/12</td>
|
||||
<td>$109,850</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Vivian Harrell</td>
|
||||
<td>Financial Controller</td>
|
||||
<td>San Francisco</td>
|
||||
<td>62</td>
|
||||
<td>2009/02/14</td>
|
||||
<td>$452,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Timothy Mooney</td>
|
||||
<td>Office Manager</td>
|
||||
<td>London</td>
|
||||
<td>37</td>
|
||||
<td>2008/12/11</td>
|
||||
<td>$136,200</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jackson Bradshaw</td>
|
||||
<td>Director</td>
|
||||
<td>New York</td>
|
||||
<td>65</td>
|
||||
<td>2008/09/26</td>
|
||||
<td>$645,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Olivia Liang</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>Singapore</td>
|
||||
<td>64</td>
|
||||
<td>2011/02/03</td>
|
||||
<td>$234,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruno Nash</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>London</td>
|
||||
<td>38</td>
|
||||
<td>2011/05/03</td>
|
||||
<td>$163,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sakura Yamamoto</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>Tokyo</td>
|
||||
<td>37</td>
|
||||
<td>2009/08/19</td>
|
||||
<td>$139,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Thor Walton</td>
|
||||
<td>Developer</td>
|
||||
<td>New York</td>
|
||||
<td>61</td>
|
||||
<td>2013/08/11</td>
|
||||
<td>$98,540</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Finn Camacho</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>47</td>
|
||||
<td>2009/07/07</td>
|
||||
<td>$87,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Serge Baldwin</td>
|
||||
<td>Data Coordinator</td>
|
||||
<td>Singapore</td>
|
||||
<td>64</td>
|
||||
<td>2012/04/09</td>
|
||||
<td>$138,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Zenaida Frank</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>New York</td>
|
||||
<td>63</td>
|
||||
<td>2010/01/04</td>
|
||||
<td>$125,250</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Zorita Serrano</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>56</td>
|
||||
<td>2012/06/01</td>
|
||||
<td>$115,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jennifer Acosta</td>
|
||||
<td>Junior Javascript Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>43</td>
|
||||
<td>2013/02/01</td>
|
||||
<td>$75,650</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cara Stevens</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>New York</td>
|
||||
<td>46</td>
|
||||
<td>2011/12/06</td>
|
||||
<td>$145,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hermione Butler</td>
|
||||
<td>Regional Director</td>
|
||||
<td>London</td>
|
||||
<td>47</td>
|
||||
<td>2011/03/21</td>
|
||||
<td>$356,250</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Lael Greer</td>
|
||||
<td>Systems Administrator</td>
|
||||
<td>London</td>
|
||||
<td>21</td>
|
||||
<td>2009/02/27</td>
|
||||
<td>$103,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jonas Alexander</td>
|
||||
<td>Developer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>30</td>
|
||||
<td>2010/07/14</td>
|
||||
<td>$86,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Shad Decker</td>
|
||||
<td>Regional Director</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>51</td>
|
||||
<td>2008/11/13</td>
|
||||
<td>$183,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Michael Bruce</td>
|
||||
<td>Javascript Developer</td>
|
||||
<td>Singapore</td>
|
||||
<td>29</td>
|
||||
<td>2011/06/27</td>
|
||||
<td>$183,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Donna Snider</td>
|
||||
<td>Customer Support</td>
|
||||
<td>New York</td>
|
||||
<td>27</td>
|
||||
<td>2011/01/25</td>
|
||||
<td>$112,000</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 brush: js;">$(document).ready(function() {
|
||||
var table = $('#example').DataTable();
|
||||
|
||||
$('#example tbody').on( 'click', 'tr', function () {
|
||||
if ( $(this).hasClass('selected') ) {
|
||||
$(this).removeClass('selected');
|
||||
}
|
||||
else {
|
||||
table.$('tr.selected').removeClass('selected');
|
||||
$(this).addClass('selected');
|
||||
}
|
||||
} );
|
||||
|
||||
$('#button').click( function () {
|
||||
table.row('.selected').remove().draw( false );
|
||||
} );
|
||||
} );</code>
|
||||
|
||||
<p>In addition to the above code, the following Javascript library files are loaded for use in this
|
||||
example:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="../../media/js/jquery.js">../../media/js/jquery.js</a></li>
|
||||
<li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="table">
|
||||
<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 brush: js;"></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>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<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_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/scroll_y_theme.html">Scroll - vertical with jQuery UI
|
||||
ThemeRoller</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 (rowspan /
|
||||
colspan)</a></li>
|
||||
<li><a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes</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</a></li>
|
||||
<li><a href="../styling/foundation.html">Foundation</a></li>
|
||||
<li><a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</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 class="active"><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 jQuery UI 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/extras">extras</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-2014<br>
|
||||
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
793
app/static/global/plugins/datatables/examples/api/show_hide.html
Normal file
793
app/static/global/plugins/datatables/examples/api/show_hide.html
Normal file
@ -0,0 +1,793 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<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">
|
||||
|
||||
<title>DataTables example - Show / hide columns dynamically</title>
|
||||
<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>
|
||||
<script type="text/javascript" language="javascript" src="../../media/js/jquery.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 type="text/javascript" language="javascript" class="init">
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
var table = $('#example').DataTable( {
|
||||
"scrollY": "200px",
|
||||
"paging": false
|
||||
} );
|
||||
|
||||
$('a.toggle-vis').on( 'click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Get the column API object
|
||||
var column = table.column( $(this).attr('data-column') );
|
||||
|
||||
// Toggle the visibility
|
||||
column.visible( ! column.visible() );
|
||||
} );
|
||||
} );
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body class="dt-example">
|
||||
<div class="container">
|
||||
<section>
|
||||
<h1>DataTables example <span>Show / hide columns dynamically</span></h1>
|
||||
|
||||
<div class="info">
|
||||
<p>This example shows how you can make use of the <a href=
|
||||
"//datatables.net/reference/api/column().visible()"><code class="api" title=
|
||||
"DataTables API method">column().visible()<span>DT</span></code></a> API method to dynamically show and
|
||||
hide columns in a table. Also included here is scrolling, just to show it enabled with this API method,
|
||||
although that is not required for the API function to work.</p>
|
||||
|
||||
<p>In addition to this, groups of columns can be shown and hidden at the same time using the <a href=
|
||||
"//datatables.net/reference/api/columns()"><code class="api" title=
|
||||
"DataTables API method">columns()<span>DT</span></code></a> method to select multiple columns and then
|
||||
using the <a href="//datatables.net/reference/api/columns().visible()"><code class="api" title=
|
||||
"DataTables API method">columns().visible()<span>DT</span></code></a> method to set their state.</p>
|
||||
|
||||
<p>If you are looking for a more complete column visibility interaction controls <a href=
|
||||
"http://datatables.net/extras/colvis">ColVis for DataTables</a> provides a complete interface for
|
||||
allowing the user to show and hide columns in the table.</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
Toggle column: <a class="toggle-vis" data-column="0">Name</a> - <a class="toggle-vis" data-column=
|
||||
"1">Position</a> - <a class="toggle-vis" data-column="2">Office</a> - <a class="toggle-vis"
|
||||
data-column="3">Age</a> - <a class="toggle-vis" data-column="4">Start date</a> - <a class="toggle-vis"
|
||||
data-column="5">Salary</a>
|
||||
</div>
|
||||
|
||||
<table id="example" class="display" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Position</th>
|
||||
<th>Office</th>
|
||||
<th>Age</th>
|
||||
<th>Start date</th>
|
||||
<th>Salary</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Position</th>
|
||||
<th>Office</th>
|
||||
<th>Age</th>
|
||||
<th>Start date</th>
|
||||
<th>Salary</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Tiger Nixon</td>
|
||||
<td>System Architect</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>61</td>
|
||||
<td>2011/04/25</td>
|
||||
<td>$320,800</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Garrett Winters</td>
|
||||
<td>Accountant</td>
|
||||
<td>Tokyo</td>
|
||||
<td>63</td>
|
||||
<td>2011/07/25</td>
|
||||
<td>$170,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Ashton Cox</td>
|
||||
<td>Junior Technical Author</td>
|
||||
<td>San Francisco</td>
|
||||
<td>66</td>
|
||||
<td>2009/01/12</td>
|
||||
<td>$86,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cedric Kelly</td>
|
||||
<td>Senior Javascript Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>22</td>
|
||||
<td>2012/03/29</td>
|
||||
<td>$433,060</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Airi Satou</td>
|
||||
<td>Accountant</td>
|
||||
<td>Tokyo</td>
|
||||
<td>33</td>
|
||||
<td>2008/11/28</td>
|
||||
<td>$162,700</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Brielle Williamson</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>New York</td>
|
||||
<td>61</td>
|
||||
<td>2012/12/02</td>
|
||||
<td>$372,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Herrod Chandler</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>San Francisco</td>
|
||||
<td>59</td>
|
||||
<td>2012/08/06</td>
|
||||
<td>$137,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Rhona Davidson</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>Tokyo</td>
|
||||
<td>55</td>
|
||||
<td>2010/10/14</td>
|
||||
<td>$327,900</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Colleen Hurst</td>
|
||||
<td>Javascript Developer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>39</td>
|
||||
<td>2009/09/15</td>
|
||||
<td>$205,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sonya Frost</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>23</td>
|
||||
<td>2008/12/13</td>
|
||||
<td>$103,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jena Gaines</td>
|
||||
<td>Office Manager</td>
|
||||
<td>London</td>
|
||||
<td>30</td>
|
||||
<td>2008/12/19</td>
|
||||
<td>$90,560</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Quinn Flynn</td>
|
||||
<td>Support Lead</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>22</td>
|
||||
<td>2013/03/03</td>
|
||||
<td>$342,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Charde Marshall</td>
|
||||
<td>Regional Director</td>
|
||||
<td>San Francisco</td>
|
||||
<td>36</td>
|
||||
<td>2008/10/16</td>
|
||||
<td>$470,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Haley Kennedy</td>
|
||||
<td>Senior Marketing Designer</td>
|
||||
<td>London</td>
|
||||
<td>43</td>
|
||||
<td>2012/12/18</td>
|
||||
<td>$313,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Tatyana Fitzpatrick</td>
|
||||
<td>Regional Director</td>
|
||||
<td>London</td>
|
||||
<td>19</td>
|
||||
<td>2010/03/17</td>
|
||||
<td>$385,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Michael Silva</td>
|
||||
<td>Marketing Designer</td>
|
||||
<td>London</td>
|
||||
<td>66</td>
|
||||
<td>2012/11/27</td>
|
||||
<td>$198,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Paul Byrd</td>
|
||||
<td>Chief Financial Officer (CFO)</td>
|
||||
<td>New York</td>
|
||||
<td>64</td>
|
||||
<td>2010/06/09</td>
|
||||
<td>$725,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gloria Little</td>
|
||||
<td>Systems Administrator</td>
|
||||
<td>New York</td>
|
||||
<td>59</td>
|
||||
<td>2009/04/10</td>
|
||||
<td>$237,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bradley Greer</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>London</td>
|
||||
<td>41</td>
|
||||
<td>2012/10/13</td>
|
||||
<td>$132,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Dai Rios</td>
|
||||
<td>Personnel Lead</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>35</td>
|
||||
<td>2012/09/26</td>
|
||||
<td>$217,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jenette Caldwell</td>
|
||||
<td>Development Lead</td>
|
||||
<td>New York</td>
|
||||
<td>30</td>
|
||||
<td>2011/09/03</td>
|
||||
<td>$345,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Yuri Berry</td>
|
||||
<td>Chief Marketing Officer (CMO)</td>
|
||||
<td>New York</td>
|
||||
<td>40</td>
|
||||
<td>2009/06/25</td>
|
||||
<td>$675,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Caesar Vance</td>
|
||||
<td>Pre-Sales Support</td>
|
||||
<td>New York</td>
|
||||
<td>21</td>
|
||||
<td>2011/12/12</td>
|
||||
<td>$106,450</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Doris Wilder</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>Sidney</td>
|
||||
<td>23</td>
|
||||
<td>2010/09/20</td>
|
||||
<td>$85,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Angelica Ramos</td>
|
||||
<td>Chief Executive Officer (CEO)</td>
|
||||
<td>London</td>
|
||||
<td>47</td>
|
||||
<td>2009/10/09</td>
|
||||
<td>$1,200,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gavin Joyce</td>
|
||||
<td>Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>42</td>
|
||||
<td>2010/12/22</td>
|
||||
<td>$92,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jennifer Chang</td>
|
||||
<td>Regional Director</td>
|
||||
<td>Singapore</td>
|
||||
<td>28</td>
|
||||
<td>2010/11/14</td>
|
||||
<td>$357,650</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Brenden Wagner</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>28</td>
|
||||
<td>2011/06/07</td>
|
||||
<td>$206,850</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fiona Green</td>
|
||||
<td>Chief Operating Officer (COO)</td>
|
||||
<td>San Francisco</td>
|
||||
<td>48</td>
|
||||
<td>2010/03/11</td>
|
||||
<td>$850,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Shou Itou</td>
|
||||
<td>Regional Marketing</td>
|
||||
<td>Tokyo</td>
|
||||
<td>20</td>
|
||||
<td>2011/08/14</td>
|
||||
<td>$163,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Michelle House</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>Sidney</td>
|
||||
<td>37</td>
|
||||
<td>2011/06/02</td>
|
||||
<td>$95,400</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Suki Burks</td>
|
||||
<td>Developer</td>
|
||||
<td>London</td>
|
||||
<td>53</td>
|
||||
<td>2009/10/22</td>
|
||||
<td>$114,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Prescott Bartlett</td>
|
||||
<td>Technical Author</td>
|
||||
<td>London</td>
|
||||
<td>27</td>
|
||||
<td>2011/05/07</td>
|
||||
<td>$145,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gavin Cortez</td>
|
||||
<td>Team Leader</td>
|
||||
<td>San Francisco</td>
|
||||
<td>22</td>
|
||||
<td>2008/10/26</td>
|
||||
<td>$235,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Martena Mccray</td>
|
||||
<td>Post-Sales support</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>46</td>
|
||||
<td>2011/03/09</td>
|
||||
<td>$324,050</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Unity Butler</td>
|
||||
<td>Marketing Designer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>47</td>
|
||||
<td>2009/12/09</td>
|
||||
<td>$85,675</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Howard Hatfield</td>
|
||||
<td>Office Manager</td>
|
||||
<td>San Francisco</td>
|
||||
<td>51</td>
|
||||
<td>2008/12/16</td>
|
||||
<td>$164,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hope Fuentes</td>
|
||||
<td>Secretary</td>
|
||||
<td>San Francisco</td>
|
||||
<td>41</td>
|
||||
<td>2010/02/12</td>
|
||||
<td>$109,850</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Vivian Harrell</td>
|
||||
<td>Financial Controller</td>
|
||||
<td>San Francisco</td>
|
||||
<td>62</td>
|
||||
<td>2009/02/14</td>
|
||||
<td>$452,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Timothy Mooney</td>
|
||||
<td>Office Manager</td>
|
||||
<td>London</td>
|
||||
<td>37</td>
|
||||
<td>2008/12/11</td>
|
||||
<td>$136,200</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jackson Bradshaw</td>
|
||||
<td>Director</td>
|
||||
<td>New York</td>
|
||||
<td>65</td>
|
||||
<td>2008/09/26</td>
|
||||
<td>$645,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Olivia Liang</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>Singapore</td>
|
||||
<td>64</td>
|
||||
<td>2011/02/03</td>
|
||||
<td>$234,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruno Nash</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>London</td>
|
||||
<td>38</td>
|
||||
<td>2011/05/03</td>
|
||||
<td>$163,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sakura Yamamoto</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>Tokyo</td>
|
||||
<td>37</td>
|
||||
<td>2009/08/19</td>
|
||||
<td>$139,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Thor Walton</td>
|
||||
<td>Developer</td>
|
||||
<td>New York</td>
|
||||
<td>61</td>
|
||||
<td>2013/08/11</td>
|
||||
<td>$98,540</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Finn Camacho</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>47</td>
|
||||
<td>2009/07/07</td>
|
||||
<td>$87,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Serge Baldwin</td>
|
||||
<td>Data Coordinator</td>
|
||||
<td>Singapore</td>
|
||||
<td>64</td>
|
||||
<td>2012/04/09</td>
|
||||
<td>$138,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Zenaida Frank</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>New York</td>
|
||||
<td>63</td>
|
||||
<td>2010/01/04</td>
|
||||
<td>$125,250</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Zorita Serrano</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>56</td>
|
||||
<td>2012/06/01</td>
|
||||
<td>$115,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jennifer Acosta</td>
|
||||
<td>Junior Javascript Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>43</td>
|
||||
<td>2013/02/01</td>
|
||||
<td>$75,650</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cara Stevens</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>New York</td>
|
||||
<td>46</td>
|
||||
<td>2011/12/06</td>
|
||||
<td>$145,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hermione Butler</td>
|
||||
<td>Regional Director</td>
|
||||
<td>London</td>
|
||||
<td>47</td>
|
||||
<td>2011/03/21</td>
|
||||
<td>$356,250</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Lael Greer</td>
|
||||
<td>Systems Administrator</td>
|
||||
<td>London</td>
|
||||
<td>21</td>
|
||||
<td>2009/02/27</td>
|
||||
<td>$103,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jonas Alexander</td>
|
||||
<td>Developer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>30</td>
|
||||
<td>2010/07/14</td>
|
||||
<td>$86,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Shad Decker</td>
|
||||
<td>Regional Director</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>51</td>
|
||||
<td>2008/11/13</td>
|
||||
<td>$183,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Michael Bruce</td>
|
||||
<td>Javascript Developer</td>
|
||||
<td>Singapore</td>
|
||||
<td>29</td>
|
||||
<td>2011/06/27</td>
|
||||
<td>$183,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Donna Snider</td>
|
||||
<td>Customer Support</td>
|
||||
<td>New York</td>
|
||||
<td>27</td>
|
||||
<td>2011/01/25</td>
|
||||
<td>$112,000</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 brush: js;">$(document).ready(function() {
|
||||
var table = $('#example').DataTable( {
|
||||
"scrollY": "200px",
|
||||
"paging": false
|
||||
} );
|
||||
|
||||
$('a.toggle-vis').on( 'click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Get the column API object
|
||||
var column = table.column( $(this).attr('data-column') );
|
||||
|
||||
// Toggle the visibility
|
||||
column.visible( ! column.visible() );
|
||||
} );
|
||||
} );</code>
|
||||
|
||||
<p>In addition to the above code, the following Javascript library files are loaded for use in this
|
||||
example:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="../../media/js/jquery.js">../../media/js/jquery.js</a></li>
|
||||
<li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="table">
|
||||
<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 brush: js;"></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>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<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_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/scroll_y_theme.html">Scroll - vertical with jQuery UI
|
||||
ThemeRoller</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 (rowspan /
|
||||
colspan)</a></li>
|
||||
<li><a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes</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</a></li>
|
||||
<li><a href="../styling/foundation.html">Foundation</a></li>
|
||||
<li><a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</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 class="active"><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 jQuery UI 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/extras">extras</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-2014<br>
|
||||
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,790 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<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">
|
||||
|
||||
<title>DataTables example - Scrolling and jQuery UI tabs</title>
|
||||
<link rel="stylesheet" type="text/css" href="//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
|
||||
<link rel="stylesheet" type="text/css" href=
|
||||
"../../extensions/Plugins/integration/jqueryui/dataTables.jqueryui.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>
|
||||
<script type="text/javascript" language="javascript" src="../../media/js/jquery.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="//code.jquery.com/ui/1.10.3/jquery-ui.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 type="text/javascript" language="javascript" class="init">
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#tabs").tabs( {
|
||||
"activate": function(event, ui) {
|
||||
$( $.fn.dataTable.tables( true ) ).DataTable().columns.adjust();
|
||||
}
|
||||
} );
|
||||
|
||||
$('table.display').dataTable( {
|
||||
"scrollY": "200px",
|
||||
"scrollCollapse": true,
|
||||
"paging": false,
|
||||
"jQueryUI": true
|
||||
} );
|
||||
} );
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body class="dt-example">
|
||||
<div class="container">
|
||||
<section>
|
||||
<h1>DataTables example <span>Scrolling and jQuery UI tabs</span></h1>
|
||||
|
||||
<div class="info">
|
||||
<p>This example shows how DataTables with scrolling can be used together with jQuery UI tabs (or indeed
|
||||
any other method whereby the table is in a hidden, <code>display:none</code>, element when it is
|
||||
initialised). 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>
|
||||
|
||||
<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()<span>DT</span></code></a> method when the table is made
|
||||
visible (i.e. it has dimensions).</p>
|
||||
|
||||
<p>This example shows how the jQuery UI <code>show</code> event can be used to trigger this method
|
||||
call. The visible tables on the page are selected using the static <code>dt-api-static tables()</code>
|
||||
method and passing the result to <a href="//datatables.net/reference/api/columns.adjust()"><code class=
|
||||
"api" title="DataTables API method">columns.adjust()<span>DT</span></code></a>.</p>
|
||||
</div>
|
||||
|
||||
<table id="example" class="display" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Position</th>
|
||||
<th>Office</th>
|
||||
<th>Age</th>
|
||||
<th>Start date</th>
|
||||
<th>Salary</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Position</th>
|
||||
<th>Office</th>
|
||||
<th>Age</th>
|
||||
<th>Start date</th>
|
||||
<th>Salary</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Tiger Nixon</td>
|
||||
<td>System Architect</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>61</td>
|
||||
<td>2011/04/25</td>
|
||||
<td>$320,800</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Garrett Winters</td>
|
||||
<td>Accountant</td>
|
||||
<td>Tokyo</td>
|
||||
<td>63</td>
|
||||
<td>2011/07/25</td>
|
||||
<td>$170,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Ashton Cox</td>
|
||||
<td>Junior Technical Author</td>
|
||||
<td>San Francisco</td>
|
||||
<td>66</td>
|
||||
<td>2009/01/12</td>
|
||||
<td>$86,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cedric Kelly</td>
|
||||
<td>Senior Javascript Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>22</td>
|
||||
<td>2012/03/29</td>
|
||||
<td>$433,060</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Airi Satou</td>
|
||||
<td>Accountant</td>
|
||||
<td>Tokyo</td>
|
||||
<td>33</td>
|
||||
<td>2008/11/28</td>
|
||||
<td>$162,700</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Brielle Williamson</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>New York</td>
|
||||
<td>61</td>
|
||||
<td>2012/12/02</td>
|
||||
<td>$372,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Herrod Chandler</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>San Francisco</td>
|
||||
<td>59</td>
|
||||
<td>2012/08/06</td>
|
||||
<td>$137,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Rhona Davidson</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>Tokyo</td>
|
||||
<td>55</td>
|
||||
<td>2010/10/14</td>
|
||||
<td>$327,900</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Colleen Hurst</td>
|
||||
<td>Javascript Developer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>39</td>
|
||||
<td>2009/09/15</td>
|
||||
<td>$205,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sonya Frost</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>23</td>
|
||||
<td>2008/12/13</td>
|
||||
<td>$103,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jena Gaines</td>
|
||||
<td>Office Manager</td>
|
||||
<td>London</td>
|
||||
<td>30</td>
|
||||
<td>2008/12/19</td>
|
||||
<td>$90,560</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Quinn Flynn</td>
|
||||
<td>Support Lead</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>22</td>
|
||||
<td>2013/03/03</td>
|
||||
<td>$342,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Charde Marshall</td>
|
||||
<td>Regional Director</td>
|
||||
<td>San Francisco</td>
|
||||
<td>36</td>
|
||||
<td>2008/10/16</td>
|
||||
<td>$470,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Haley Kennedy</td>
|
||||
<td>Senior Marketing Designer</td>
|
||||
<td>London</td>
|
||||
<td>43</td>
|
||||
<td>2012/12/18</td>
|
||||
<td>$313,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Tatyana Fitzpatrick</td>
|
||||
<td>Regional Director</td>
|
||||
<td>London</td>
|
||||
<td>19</td>
|
||||
<td>2010/03/17</td>
|
||||
<td>$385,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Michael Silva</td>
|
||||
<td>Marketing Designer</td>
|
||||
<td>London</td>
|
||||
<td>66</td>
|
||||
<td>2012/11/27</td>
|
||||
<td>$198,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Paul Byrd</td>
|
||||
<td>Chief Financial Officer (CFO)</td>
|
||||
<td>New York</td>
|
||||
<td>64</td>
|
||||
<td>2010/06/09</td>
|
||||
<td>$725,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gloria Little</td>
|
||||
<td>Systems Administrator</td>
|
||||
<td>New York</td>
|
||||
<td>59</td>
|
||||
<td>2009/04/10</td>
|
||||
<td>$237,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bradley Greer</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>London</td>
|
||||
<td>41</td>
|
||||
<td>2012/10/13</td>
|
||||
<td>$132,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Dai Rios</td>
|
||||
<td>Personnel Lead</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>35</td>
|
||||
<td>2012/09/26</td>
|
||||
<td>$217,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jenette Caldwell</td>
|
||||
<td>Development Lead</td>
|
||||
<td>New York</td>
|
||||
<td>30</td>
|
||||
<td>2011/09/03</td>
|
||||
<td>$345,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Yuri Berry</td>
|
||||
<td>Chief Marketing Officer (CMO)</td>
|
||||
<td>New York</td>
|
||||
<td>40</td>
|
||||
<td>2009/06/25</td>
|
||||
<td>$675,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Caesar Vance</td>
|
||||
<td>Pre-Sales Support</td>
|
||||
<td>New York</td>
|
||||
<td>21</td>
|
||||
<td>2011/12/12</td>
|
||||
<td>$106,450</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Doris Wilder</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>Sidney</td>
|
||||
<td>23</td>
|
||||
<td>2010/09/20</td>
|
||||
<td>$85,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Angelica Ramos</td>
|
||||
<td>Chief Executive Officer (CEO)</td>
|
||||
<td>London</td>
|
||||
<td>47</td>
|
||||
<td>2009/10/09</td>
|
||||
<td>$1,200,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gavin Joyce</td>
|
||||
<td>Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>42</td>
|
||||
<td>2010/12/22</td>
|
||||
<td>$92,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jennifer Chang</td>
|
||||
<td>Regional Director</td>
|
||||
<td>Singapore</td>
|
||||
<td>28</td>
|
||||
<td>2010/11/14</td>
|
||||
<td>$357,650</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Brenden Wagner</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>28</td>
|
||||
<td>2011/06/07</td>
|
||||
<td>$206,850</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fiona Green</td>
|
||||
<td>Chief Operating Officer (COO)</td>
|
||||
<td>San Francisco</td>
|
||||
<td>48</td>
|
||||
<td>2010/03/11</td>
|
||||
<td>$850,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Shou Itou</td>
|
||||
<td>Regional Marketing</td>
|
||||
<td>Tokyo</td>
|
||||
<td>20</td>
|
||||
<td>2011/08/14</td>
|
||||
<td>$163,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Michelle House</td>
|
||||
<td>Integration Specialist</td>
|
||||
<td>Sidney</td>
|
||||
<td>37</td>
|
||||
<td>2011/06/02</td>
|
||||
<td>$95,400</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Suki Burks</td>
|
||||
<td>Developer</td>
|
||||
<td>London</td>
|
||||
<td>53</td>
|
||||
<td>2009/10/22</td>
|
||||
<td>$114,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Prescott Bartlett</td>
|
||||
<td>Technical Author</td>
|
||||
<td>London</td>
|
||||
<td>27</td>
|
||||
<td>2011/05/07</td>
|
||||
<td>$145,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gavin Cortez</td>
|
||||
<td>Team Leader</td>
|
||||
<td>San Francisco</td>
|
||||
<td>22</td>
|
||||
<td>2008/10/26</td>
|
||||
<td>$235,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Martena Mccray</td>
|
||||
<td>Post-Sales support</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>46</td>
|
||||
<td>2011/03/09</td>
|
||||
<td>$324,050</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Unity Butler</td>
|
||||
<td>Marketing Designer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>47</td>
|
||||
<td>2009/12/09</td>
|
||||
<td>$85,675</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Howard Hatfield</td>
|
||||
<td>Office Manager</td>
|
||||
<td>San Francisco</td>
|
||||
<td>51</td>
|
||||
<td>2008/12/16</td>
|
||||
<td>$164,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hope Fuentes</td>
|
||||
<td>Secretary</td>
|
||||
<td>San Francisco</td>
|
||||
<td>41</td>
|
||||
<td>2010/02/12</td>
|
||||
<td>$109,850</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Vivian Harrell</td>
|
||||
<td>Financial Controller</td>
|
||||
<td>San Francisco</td>
|
||||
<td>62</td>
|
||||
<td>2009/02/14</td>
|
||||
<td>$452,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Timothy Mooney</td>
|
||||
<td>Office Manager</td>
|
||||
<td>London</td>
|
||||
<td>37</td>
|
||||
<td>2008/12/11</td>
|
||||
<td>$136,200</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jackson Bradshaw</td>
|
||||
<td>Director</td>
|
||||
<td>New York</td>
|
||||
<td>65</td>
|
||||
<td>2008/09/26</td>
|
||||
<td>$645,750</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Olivia Liang</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>Singapore</td>
|
||||
<td>64</td>
|
||||
<td>2011/02/03</td>
|
||||
<td>$234,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruno Nash</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>London</td>
|
||||
<td>38</td>
|
||||
<td>2011/05/03</td>
|
||||
<td>$163,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sakura Yamamoto</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>Tokyo</td>
|
||||
<td>37</td>
|
||||
<td>2009/08/19</td>
|
||||
<td>$139,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Thor Walton</td>
|
||||
<td>Developer</td>
|
||||
<td>New York</td>
|
||||
<td>61</td>
|
||||
<td>2013/08/11</td>
|
||||
<td>$98,540</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Finn Camacho</td>
|
||||
<td>Support Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>47</td>
|
||||
<td>2009/07/07</td>
|
||||
<td>$87,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Serge Baldwin</td>
|
||||
<td>Data Coordinator</td>
|
||||
<td>Singapore</td>
|
||||
<td>64</td>
|
||||
<td>2012/04/09</td>
|
||||
<td>$138,575</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Zenaida Frank</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>New York</td>
|
||||
<td>63</td>
|
||||
<td>2010/01/04</td>
|
||||
<td>$125,250</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Zorita Serrano</td>
|
||||
<td>Software Engineer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>56</td>
|
||||
<td>2012/06/01</td>
|
||||
<td>$115,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jennifer Acosta</td>
|
||||
<td>Junior Javascript Developer</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>43</td>
|
||||
<td>2013/02/01</td>
|
||||
<td>$75,650</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cara Stevens</td>
|
||||
<td>Sales Assistant</td>
|
||||
<td>New York</td>
|
||||
<td>46</td>
|
||||
<td>2011/12/06</td>
|
||||
<td>$145,600</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hermione Butler</td>
|
||||
<td>Regional Director</td>
|
||||
<td>London</td>
|
||||
<td>47</td>
|
||||
<td>2011/03/21</td>
|
||||
<td>$356,250</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Lael Greer</td>
|
||||
<td>Systems Administrator</td>
|
||||
<td>London</td>
|
||||
<td>21</td>
|
||||
<td>2009/02/27</td>
|
||||
<td>$103,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jonas Alexander</td>
|
||||
<td>Developer</td>
|
||||
<td>San Francisco</td>
|
||||
<td>30</td>
|
||||
<td>2010/07/14</td>
|
||||
<td>$86,500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Shad Decker</td>
|
||||
<td>Regional Director</td>
|
||||
<td>Edinburgh</td>
|
||||
<td>51</td>
|
||||
<td>2008/11/13</td>
|
||||
<td>$183,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Michael Bruce</td>
|
||||
<td>Javascript Developer</td>
|
||||
<td>Singapore</td>
|
||||
<td>29</td>
|
||||
<td>2011/06/27</td>
|
||||
<td>$183,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Donna Snider</td>
|
||||
<td>Customer Support</td>
|
||||
<td>New York</td>
|
||||
<td>27</td>
|
||||
<td>2011/01/25</td>
|
||||
<td>$112,000</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 brush: js;">$(document).ready(function() {
|
||||
$("#tabs").tabs( {
|
||||
"activate": function(event, ui) {
|
||||
$( $.fn.dataTable.tables( true ) ).DataTable().columns.adjust();
|
||||
}
|
||||
} );
|
||||
|
||||
$('table.display').dataTable( {
|
||||
"scrollY": "200px",
|
||||
"scrollCollapse": true,
|
||||
"paging": false,
|
||||
"jQueryUI": true
|
||||
} );
|
||||
} );</code>
|
||||
|
||||
<p>In addition to the above code, the following Javascript library files are loaded for use in this
|
||||
example:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="../../media/js/jquery.js">../../media/js/jquery.js</a></li>
|
||||
<li><a href=
|
||||
"//code.jquery.com/ui/1.10.3/jquery-ui.js">//code.jquery.com/ui/1.10.3/jquery-ui.js</a></li>
|
||||
<li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="table">
|
||||
<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 brush: js;"></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=
|
||||
"//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css</a></li>
|
||||
<li><a href=
|
||||
"../../extensions/Plugins/integration/jqueryui/dataTables.jqueryui.css">../../extensions/Plugins/integration/jqueryui/dataTables.jqueryui.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>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<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_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/scroll_y_theme.html">Scroll - vertical with jQuery UI
|
||||
ThemeRoller</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 (rowspan /
|
||||
colspan)</a></li>
|
||||
<li><a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes</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</a></li>
|
||||
<li><a href="../styling/foundation.html">Foundation</a></li>
|
||||
<li><a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</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 jQuery UI
|
||||
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/extras">extras</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-2014<br>
|
||||
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user