api_scrolling.html
2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
<title>DataTables example</title>
<style type="text/css">
@import "../../media/css/demo_page.css";
@import "../../media/css/demo_table.css";
@import "media/css/dataTables.scroller.css";
</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="media/js/dataTables.scroller.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('#example').dataTable( {
"sScrollY": "200px",
"sAjaxSource": "media/data/2500.txt",
"sDom": "frtiS",
"bDeferRender": true,
"fnInitComplete": function () {
this.fnSettings().oScroller.fnScrollToRow( 1000 );
}
} );
} );
</script>
</head>
<body id="dt_example">
<div id="container" style="width:980px">
<div class="full_width big">
Scroller API example
</div>
<h1>Preamble</h1>
<p>This example shows a trivial use of the Scroller API to scroll the table to row 1000 once the table has been loaded. Any number could be used here, and a small animated effect is used to provide visual feedback to the user (this can be disabled by passed false as a second parameter to fnScrollToRow).</p>
<h1>Live example</h1>
<div id="demo">
<table class="display" id="example">
<thead>
<tr>
<th>ID</th>
<th>First name</th>
<th>Last name</th>
<th>ZIP</th>
<th width="33%">Country</th>
</tr>
</thead>
</table>
</div>
<div class="spacer"></div>
<h1>Initialisation code</h1>
<pre>$(document).ready(function() {
$('#example').dataTable( {
"sScrollY": "200px",
"sAjaxSource": "media/data/2500.txt",
"sDom": "frtiS",
"bDeferRender": true,
"fnInitComplete": function () {
this.fnSettings().oScroller.fnScrollToRow( 1000 );
}
} );
} );</pre>
<h1>Other examples</h1>
<div class="demo_links">
<ul>
<li><a href="index.html">Basic initialisation of Scroller</a></li>
<li><a href="state_saving.html">State saving</a></li>
<li><a href="api_scrolling.html">API - pragmatically move to a row</a></li>
<li><a href="server-side_processing.html">Server-side processing with Scroller</a></li>
<li><a href="large_js_source.html">50'000 rows in a table - client-side generated data</a></li>
</ul>
</div>
</div>
</body>
</html>