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 - API</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",
31 initComplete: function () {
33 api.scroller().scrollToRow( 1000 );
42 <body class="dt-example">
43 <div class="container">
45 <h1>Scroller example <span>API</span></h1>
48 <p>This example shows a trivial use of the API methods that Scroller adds to the DataTables API to
49 scroll to a row once the table's data has been loaded. In this case
50 <code>scroller().scrollToRow()</code> is used to jump to row 1000.</p>
53 <table id="example" class="display" cellspacing="0" width="100%">
59 <th>ZIP / Post code</th>
66 <li class="active">Javascript</li>
70 <li>Server-side script</li>
75 <p>The Javascript shown below is used to initialise the table shown in this
76 example:</p><code class="multiline brush: js;">$(document).ready(function() {
77 $('#example').DataTable( {
78 ajax: "data/2500.txt",
80 dom: "frtiS",
83 initComplete: function () {
85 api.scroller().scrollToRow( 1000 );
90 <p>In addition to the above code, the following Javascript library files are loaded for use in this
94 <li><a href="../../../media/js/jquery.js">../../../media/js/jquery.js</a></li>
96 "../../../media/js/jquery.dataTables.js">../../../media/js/jquery.dataTables.js</a></li>
97 <li><a href="../js/dataTables.scroller.js">../js/dataTables.scroller.js</a></li>
102 <p>The HTML shown below is the raw HTML table element, before it has been enhanced by
108 <p>This example uses a little bit of additional CSS beyond what is loaded from the library
109 files (below), in order to correctly display the table. The additional CSS used is shown
110 below:</p><code class="multiline brush: js;"></code>
113 <p>The following CSS library files are loaded for use in this example to provide the styling of the
118 "../../../media/css/jquery.dataTables.css">../../../media/css/jquery.dataTables.css</a></li>
119 <li><a href="../css/dataTables.scroller.css">../css/dataTables.scroller.css</a></li>
124 <p>This table loads data by Ajax. The latest data that has been loaded is shown below. This data
125 will update automatically as any additional data is loaded.</p>
129 <p>The script used to perform the server-side processing for this table is shown below. Please note
130 that this is just an example script using PHP. Server-side processing scripts can be written in any
131 language, using <a href="//datatables.net/manual/server-side">the protocol described in the
132 DataTables documentation</a>.</p>
140 <div class="gradient"></div>
143 <h2>Other examples</h2>
146 <div class="toc-group">
147 <h3><a href="./index.html">Examples</a></h3>
148 <ul class="toc active">
149 <li><a href="./simple.html">Basic initialisation</a></li>
150 <li><a href="./state_saving.html">State saving</a></li>
151 <li><a href="./large_js_source.html">Client-side data source (50,000 rows)</a></li>
152 <li><a href="./server-side_processing.html">Server-side processing (5,000,000
154 <li class="active"><a href="./api_scrolling.html">API</a></li>
159 <div class="epilogue">
160 <p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full
161 information about its API properties and methods.<br>
162 Additionally, there are a wide range of <a href="http://www.datatables.net/extras">extras</a> and
163 <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of
166 <p class="copyright">DataTables designed and created by <a href=
167 "http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2014<br>
168 DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>