annotate DataTables-1.9.4/extras/Scroller/server-side_processing.html @ 7:0f2b740536fb draft

Uploaded
author saskia-hiltemann
date Mon, 21 Aug 2017 09:16:07 -0400
parents ac5f9272033b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
2 <html>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
3 <head>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
4 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
5 <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
6
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
7 <title>DataTables example</title>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
8 <style type="text/css">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
9 @import "../../media/css/demo_page.css";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
10 @import "../../media/css/demo_table.css";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
11 @import "media/css/dataTables.scroller.css";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
12 </style>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
13 <script type="text/javascript" language="javascript" src="../../media/js/jquery.js"></script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
14 <script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
15 <script type="text/javascript" language="javascript" src="media/js/dataTables.scroller.js"></script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
16 <script type="text/javascript" charset="utf-8">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
17 $(document).ready(function() {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
18 var oTable = $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
19 "sScrollY": "200px",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
20 "sAjaxSource": "media/data/server_processing.php",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
21 "bServerSide": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
22 "sDom": "frtiS",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
23 "oScroller": {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
24 "loadingIndicator": true
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
25 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
26 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
27 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
28 </script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
29 </head>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
30 <body id="dt_example">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
31 <div id="container" style="width:980px">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
32 <div class="full_width big">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
33 Scroller example - server-side processing
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
34 </div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
35
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
36 <h1>Preamble</h1>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
37 <p>When using server-side processing, Scroller will wait a small amount of time to allow the scrolling to finish before requesting more data from the server (200mS by default). This prevents you from DoSing your own server! This example shows Scroller in action with a database of 10'000 records, although of course server-side processing can scale much larger if you require. In this example we also enable the <i>loadingIndicator</i> option of Scroller to show the end user what is happening when they scroll passed the currently loaded data.</p>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
38
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
39 <h1>Live example</h1>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
40 <div id="demo">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
41 <table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
42 <thead>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
43 <tr>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
44 <th>ID</th>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
45 <th>First name</th>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
46 <th>Last name</th>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
47 <th>ZIP</th>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
48 <th width="33%">Country</th>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
49 </tr>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
50 </thead>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
51 </table>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
52 </div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
53 <div class="spacer"></div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
54
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
55
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
56 <h1>Initialisation code</h1>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
57 <pre>$(document).ready(function() {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
58 var oTable = $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
59 "sScrollY": "200px",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
60 "sAjaxSource": "media/data/server_processing.php",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
61 "bServerSide": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
62 "sDom": "frtiS",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
63 "oScroller": {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
64 "loadingIndicator": true
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
65 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
66 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
67 } );</pre>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
68
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
69
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
70 <h1>Other examples</h1>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
71 <div class="demo_links">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
72 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
73 <li><a href="index.html">Basic initialisation of Scroller</a></li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
74 <li><a href="state_saving.html">State saving</a></li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
75 <li><a href="api_scrolling.html">API - pragmatically move to a row</a></li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
76 <li><a href="server-side_processing.html">Server-side processing with Scroller</a></li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
77 <li><a href="large_js_source.html">50'000 rows in a table - client-side generated data</a></li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
78 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
79 </div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
80
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
81 </div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
82 </body>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
83 </html>