5 <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
6 <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0">
8 <title>TableTools example - Ajax loaded data</title>
9 <link rel="stylesheet" type="text/css" href="../../../media/css/jquery.dataTables.css">
10 <link rel="stylesheet" type="text/css" href="../css/dataTables.tableTools.css">
11 <link rel="stylesheet" type="text/css" href="../../../examples/resources/syntax/shCore.css">
12 <link rel="stylesheet" type="text/css" href="../../../examples/resources/demo.css">
13 <style type="text/css" class="init">
16 <script type="text/javascript" language="javascript" src="../../../media/js/jquery.js"></script>
17 <script type="text/javascript" language="javascript" src="../../../media/js/jquery.dataTables.js"></script>
18 <script type="text/javascript" language="javascript" src="../js/dataTables.tableTools.js"></script>
19 <script type="text/javascript" language="javascript" src="../../../examples/resources/syntax/shCore.js"></script>
20 <script type="text/javascript" language="javascript" src="../../../examples/resources/demo.js"></script>
21 <script type="text/javascript" language="javascript" class="init">
24 $(document).ready(function() {
25 $('#example').DataTable( {
26 dom: 'T<"clear">lfrtip',
27 "ajax": "../../../../examples/ajax/data/objects.txt",
30 { "data": "position" },
33 { "data": "start_date" },
44 <body class="dt-example">
45 <div class="container">
47 <h1>TableTools example <span>Ajax loaded data</span></h1>
50 <p>This TableTools example shows DataTables using its ability to <a href="//datatables.net/manual/data#Objects">Ajax load object based data</a> and operate in
51 exactly the same manner as when the data is read directly from the document.</p>
54 <table id="example" class="display" cellspacing="0" width="100%">
79 <li class="active">Javascript</li>
83 <li>Server-side script</li>
88 <p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
89 $('#example').DataTable( {
90 dom: 'T<"clear">lfrtip',
91 "ajax": "../../../../examples/ajax/data/objects.txt",
92 "columns": [
93 { "data": "name" },
94 { "data": "position" },
95 { "data": "office" },
96 { "data": "extn" },
97 { "data": "start_date" },
98 { "data": "salary" }
104 <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
107 <li><a href="../../../media/js/jquery.js">../../../media/js/jquery.js</a></li>
108 <li><a href="../../../media/js/jquery.dataTables.js">../../../media/js/jquery.dataTables.js</a></li>
109 <li><a href="../js/dataTables.tableTools.js">../js/dataTables.tableTools.js</a></li>
114 <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
119 <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
120 additional CSS used is shown below:</p><code class="multiline language-css"></code>
123 <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
126 <li><a href="../../../media/css/jquery.dataTables.css">../../../media/css/jquery.dataTables.css</a></li>
127 <li><a href="../css/dataTables.tableTools.css">../css/dataTables.tableTools.css</a></li>
132 <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
137 <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
138 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables
139 documentation</a>.</p>
147 <div class="gradient"></div>
150 <h2>Other examples</h2>
153 <div class="toc-group">
154 <h3><a href="./index.html">Examples</a></h3>
155 <ul class="toc active">
156 <li><a href="./simple.html">Basic initialisation</a></li>
157 <li><a href="./swf_path.html">Setting the SWF path</a></li>
158 <li><a href="./new_init.html">Initialisation with `new`</a></li>
159 <li><a href="./defaults.html">Defaults</a></li>
160 <li><a href="./select_single.html">Row selection - single row select</a></li>
161 <li><a href="./select_multi.html">Row selection - multi-row select</a></li>
162 <li><a href="./select_os.html">Row selection - operating system style</a></li>
163 <li><a href="./select_column.html">Row selection - row selector on specific cells</a></li>
164 <li><a href="./multiple_tables.html">Multiple tables</a></li>
165 <li><a href="./multi_instance.html">Multiple toolbars</a></li>
166 <li><a href="./collection.html">Button collections</a></li>
167 <li><a href="./plug-in.html">Plug-in button types</a></li>
168 <li><a href="./button_text.html">Custom button text</a></li>
169 <li><a href="./alter_buttons.html">Button arrangement</a></li>
170 <li class="active"><a href="./ajax.html">Ajax loaded data</a></li>
171 <li><a href="./pdf_message.html">PDF message</a></li>
172 <li><a href="./bootstrap.html">Bootstrap styling</a></li>
173 <li><a href="./jqueryui.html">jQuery UI styling</a></li>
178 <div class="epilogue">
179 <p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
180 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>
181 which extend the capabilities of DataTables.</p>
183 <p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2015<br>
184 DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>