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>Scroller example - Basic initialisation</title>
9 <link rel="stylesheet" type="text/css" href="../../../media/css/jquery.dataTables.css">
10 <link rel="stylesheet" type="text/css" href="../css/dataTables.scroller.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.scroller.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 ajax: "data/2500.txt",
38 <body class="dt-example">
39 <div class="container">
41 <h1>Scroller example <span>Basic initialisation</span></h1>
44 <p>Scroller is a plug-in for DataTables which enhances DataTables' built-in scrolling features to allow
45 large amounts of data to be rendered on page very quickly. This is done by Scroller through the use of
46 a virtual rendering technique that will render only the part of the table that is actually required for
49 <p>Note that Scroller assumes that all rows are of the same height (in order to preform the required
50 calculations. You can use <code>td { white-space: nowrap; }</code> in your CSS to ensure that text in
51 rows does not wrap.</p>
53 <p>This example shows how Scroller for DataTables can be initialised by simply including the character
54 <code>S</code> in sDom (note that the <code>S</code> must come after the <code>t</code> in sDom).
55 Deferred rendering an and Ajax data source are also used in this example.</p>
58 <table id="example" class="display" cellspacing="0" width="100%">
64 <th>ZIP / Post code</th>
71 <li class="active">Javascript</li>
75 <li>Server-side script</li>
80 <p>The Javascript shown below is used to initialise the table shown in this
81 example:</p><code class="multiline brush: js;">$(document).ready(function() {
82 $('#example').DataTable( {
83 ajax: "data/2500.txt",
85 dom: "frtiS",
91 <p>In addition to the above code, the following Javascript library files are loaded for use in this
95 <li><a href="../../../media/js/jquery.js">../../../media/js/jquery.js</a></li>
97 "../../../media/js/jquery.dataTables.js">../../../media/js/jquery.dataTables.js</a></li>
98 <li><a href="../js/dataTables.scroller.js">../js/dataTables.scroller.js</a></li>
103 <p>The HTML shown below is the raw HTML table element, before it has been enhanced by
109 <p>This example uses a little bit of additional CSS beyond what is loaded from the library
110 files (below), in order to correctly display the table. The additional CSS used is shown
111 below:</p><code class="multiline brush: js;"></code>
114 <p>The following CSS library files are loaded for use in this example to provide the styling of the
119 "../../../media/css/jquery.dataTables.css">../../../media/css/jquery.dataTables.css</a></li>
120 <li><a href="../css/dataTables.scroller.css">../css/dataTables.scroller.css</a></li>
125 <p>This table loads data by Ajax. The latest data that has been loaded is shown below. This data
126 will update automatically as any additional data is loaded.</p>
130 <p>The script used to perform the server-side processing for this table is shown below. Please note
131 that this is just an example script using PHP. Server-side processing scripts can be written in any
132 language, using <a href="//datatables.net/manual/server-side">the protocol described in the
133 DataTables documentation</a>.</p>
141 <div class="gradient"></div>
144 <h2>Other examples</h2>
147 <div class="toc-group">
148 <h3><a href="./index.html">Examples</a></h3>
149 <ul class="toc active">
150 <li class="active"><a href="./simple.html">Basic initialisation</a></li>
151 <li><a href="./state_saving.html">State saving</a></li>
152 <li><a href="./large_js_source.html">Client-side data source (50,000 rows)</a></li>
153 <li><a href="./server-side_processing.html">Server-side processing (5,000,000
155 <li><a href="./api_scrolling.html">API</a></li>
160 <div class="epilogue">
161 <p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full
162 information about its API properties and methods.<br>
163 Additionally, there are a wide range of <a href="http://www.datatables.net/extras">extras</a> and
164 <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of
167 <p class="copyright">DataTables designed and created by <a href=
168 "http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2014<br>
169 DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>