Subversion-Projekte lars-tiefland.ci

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
875 lars 1
<!DOCTYPE html>
2
<html>
3
<head>
4
	<meta charset="utf-8">
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">
7
 
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/scroller.datatables.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">
14
 
15
	</style>
16
	<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.11.3.min.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">
22
 
23
 
24
$(document).ready(function() {
25
	$('#example').DataTable( {
26
		ajax:           "../data/2500.txt",
27
		deferRender:    true,
28
		scrollY:        200,
29
		scrollCollapse: true,
30
		scroller:       true,
31
		initComplete: function () {
32
			var api = this.api();
33
			api.scroller().scrollToRow( 1000 );
34
		}
35
	} );
36
} );
37
 
38
 
39
	</script>
40
</head>
41
 
42
<body class="dt-example">
43
	<div class="container">
44
		<section>
45
			<h1>Scroller example <span>API</span></h1>
46
 
47
			<div class="info">
48
				<p>This example shows a trivial use of the API methods that Scroller adds to the DataTables API to scroll to a row once the table's data has been loaded. In this
49
				case <a href="//datatables.net/reference/api/scroller().scrollToRow()"><code class="api" title="Scroller API method">scroller().scrollToRow()</code></a> is used to
50
				jump to row 1000.</p>
51
			</div>
52
 
53
			<table id="example" class="display nowrap" cellspacing="0" width="100%">
54
				<thead>
55
					<tr>
56
						<th>ID</th>
57
						<th>First name</th>
58
						<th>Last name</th>
59
						<th>ZIP / Post code</th>
60
						<th>Country</th>
61
					</tr>
62
				</thead>
63
			</table>
64
 
65
			<ul class="tabs">
66
				<li class="active">Javascript</li>
67
				<li>HTML</li>
68
				<li>CSS</li>
69
				<li>Ajax</li>
70
				<li>Server-side script</li>
71
			</ul>
72
 
73
			<div class="tabs">
74
				<div class="js">
75
					<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
76
	$('#example').DataTable( {
77
		ajax:           &quot;../data/2500.txt&quot;,
78
		deferRender:    true,
79
		scrollY:        200,
80
		scrollCollapse: true,
81
		scroller:       true,
82
		initComplete: function () {
83
			var api = this.api();
84
			api.scroller().scrollToRow( 1000 );
85
		}
86
	} );
87
} );</code>
88
 
89
					<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
90
 
91
					<ul>
92
						<li><a href="//code.jquery.com/jquery-1.11.3.min.js">//code.jquery.com/jquery-1.11.3.min.js</a></li>
93
						<li><a href="../../../../media/js/jquery.dataTables.js">../../../../media/js/jquery.dataTables.js</a></li>
94
						<li><a href="../../js/dataTables.scroller.js">../../js/dataTables.scroller.js</a></li>
95
					</ul>
96
				</div>
97
 
98
				<div class="table">
99
					<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
100
				</div>
101
 
102
				<div class="css">
103
					<div>
104
						<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
105
						additional CSS used is shown below:</p><code class="multiline language-css"></code>
106
					</div>
107
 
108
					<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
109
 
110
					<ul>
111
						<li><a href="../../../../media/css/jquery.dataTables.css">../../../../media/css/jquery.dataTables.css</a></li>
112
						<li><a href="../../css/scroller.datatables.css">../../css/scroller.datatables.css</a></li>
113
					</ul>
114
				</div>
115
 
116
				<div class="ajax">
117
					<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
118
					loaded.</p>
119
				</div>
120
 
121
				<div class="php">
122
					<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
123
					processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables
124
					documentation</a>.</p>
125
				</div>
126
			</div>
127
		</section>
128
	</div>
129
 
130
	<section>
131
		<div class="footer">
132
			<div class="gradient"></div>
133
 
134
			<div class="liner">
135
				<h2>Other examples</h2>
136
 
137
				<div class="toc">
138
					<div class="toc-group">
139
						<h3><a href="./index.html">Initialisation</a></h3>
140
						<ul class="toc active">
141
							<li><a href="./simple.html">Basic initialisation</a></li>
142
							<li><a href="./state_saving.html">State saving</a></li>
143
							<li><a href="./large_js_source.html">Client-side data source (50,000 rows)</a></li>
144
							<li><a href="./server-side_processing.html">Server-side processing (5,000,000 rows)</a></li>
145
							<li class="active"><a href="./api_scrolling.html">API</a></li>
146
							<li><a href="./fixedColumns.html">FixedColumns integration</a></li>
147
						</ul>
148
					</div>
149
 
150
					<div class="toc-group">
151
						<h3><a href="../styling/index.html">Styling</a></h3>
152
						<ul class="toc">
153
							<li><a href="../styling/bootstrap.html">Bootstrap</a></li>
154
							<li><a href="../styling/foundation.html">Foundation</a></li>
155
							<li><a href="../styling/jqueryui.html">jQuery UI</a></li>
156
						</ul>
157
					</div>
158
				</div>
159
 
160
				<div class="epilogue">
161
					<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
162
					Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
163
					"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
164
 
165
					<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &#169; 2007-2015<br>
166
					DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
167
				</div>
168
			</div>
169
		</div>
170
	</section>
171
</body>
172
</html>