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 - 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/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
	} );
32
} );
33
 
34
 
35
	</script>
36
</head>
37
 
38
<body class="dt-example">
39
	<div class="container">
40
		<section>
41
			<h1>Scroller example <span>Basic initialisation</span></h1>
42
 
43
			<div class="info">
44
				<p>Scroller is a plug-in for DataTables which enhances DataTables' built-in scrolling features to allow large amounts of data to be rendered on page very quickly.
45
				This is done by Scroller through the use of a virtual rendering technique that will render only the part of the table that is actually required for the current
46
				view.</p>
47
 
48
				<p>Note that Scroller <strong>requires</strong> that all rows are of the same height (in order to preform its positional calculations). You can use the
49
				<code>nowrap</code> class of the <a href="https://datatables.net/manual/styling/classes#nowrap">DataTables default stylesheet</a>, or add <code>th, td {
50
				white-space: nowrap; }</code> to your CSS, to ensure that text in rows does not wrap.</p>
51
 
52
				<p>This example shows how Scroller for DataTables can be initialised, when the Scroller Javascript file is included, by simply setting the <a href=
53
				"//datatables.net/reference/option/scroller"><code class="option" title="Scroller initialisation option">scroller</code></a> option to <code>true</code>. This
54
				option can also be given as an object to specify initialisation options for Scroller.</p>
55
 
56
				<p>Deferred rendering (<a href="//datatables.net/reference/option/deferRender"><code class="option" title=
57
				"DataTables initialisation option">deferRender</code></a>) should be used when Scroller is enabled to gain the speed benefits offered by Scroller. The data source
58
				for this example is an Ajax file (<a href="//datatables.net/reference/option/ajax"><code class="option" title=
59
				"DataTables initialisation option">ajax</code></a>).</p>
60
			</div>
61
 
62
			<table id="example" class="display nowrap" cellspacing="0" width="100%">
63
				<thead>
64
					<tr>
65
						<th>ID</th>
66
						<th>First name</th>
67
						<th>Last name</th>
68
						<th>ZIP / Post code</th>
69
						<th>Country</th>
70
					</tr>
71
				</thead>
72
			</table>
73
 
74
			<ul class="tabs">
75
				<li class="active">Javascript</li>
76
				<li>HTML</li>
77
				<li>CSS</li>
78
				<li>Ajax</li>
79
				<li>Server-side script</li>
80
			</ul>
81
 
82
			<div class="tabs">
83
				<div class="js">
84
					<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
85
	$('#example').DataTable( {
86
		ajax:           &quot;../data/2500.txt&quot;,
87
		deferRender:    true,
88
		scrollY:        200,
89
		scrollCollapse: true,
90
		scroller:       true
91
	} );
92
} );</code>
93
 
94
					<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
95
 
96
					<ul>
97
						<li><a href="//code.jquery.com/jquery-1.11.3.min.js">//code.jquery.com/jquery-1.11.3.min.js</a></li>
98
						<li><a href="../../../../media/js/jquery.dataTables.js">../../../../media/js/jquery.dataTables.js</a></li>
99
						<li><a href="../../js/dataTables.scroller.js">../../js/dataTables.scroller.js</a></li>
100
					</ul>
101
				</div>
102
 
103
				<div class="table">
104
					<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
105
				</div>
106
 
107
				<div class="css">
108
					<div>
109
						<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
110
						additional CSS used is shown below:</p><code class="multiline language-css"></code>
111
					</div>
112
 
113
					<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
114
 
115
					<ul>
116
						<li><a href="../../../../media/css/jquery.dataTables.css">../../../../media/css/jquery.dataTables.css</a></li>
117
						<li><a href="../../css/scroller.datatables.css">../../css/scroller.datatables.css</a></li>
118
					</ul>
119
				</div>
120
 
121
				<div class="ajax">
122
					<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
123
					loaded.</p>
124
				</div>
125
 
126
				<div class="php">
127
					<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
128
					processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables
129
					documentation</a>.</p>
130
				</div>
131
			</div>
132
		</section>
133
	</div>
134
 
135
	<section>
136
		<div class="footer">
137
			<div class="gradient"></div>
138
 
139
			<div class="liner">
140
				<h2>Other examples</h2>
141
 
142
				<div class="toc">
143
					<div class="toc-group">
144
						<h3><a href="./index.html">Initialisation</a></h3>
145
						<ul class="toc active">
146
							<li class="active"><a href="./simple.html">Basic initialisation</a></li>
147
							<li><a href="./state_saving.html">State saving</a></li>
148
							<li><a href="./large_js_source.html">Client-side data source (50,000 rows)</a></li>
149
							<li><a href="./server-side_processing.html">Server-side processing (5,000,000 rows)</a></li>
150
							<li><a href="./api_scrolling.html">API</a></li>
151
							<li><a href="./fixedColumns.html">FixedColumns integration</a></li>
152
						</ul>
153
					</div>
154
 
155
					<div class="toc-group">
156
						<h3><a href="../styling/index.html">Styling</a></h3>
157
						<ul class="toc">
158
							<li><a href="../styling/bootstrap.html">Bootstrap</a></li>
159
							<li><a href="../styling/foundation.html">Foundation</a></li>
160
							<li><a href="../styling/jqueryui.html">jQuery UI</a></li>
161
						</ul>
162
					</div>
163
				</div>
164
 
165
				<div class="epilogue">
166
					<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
167
					Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
168
					"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
169
 
170
					<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &#169; 2007-2015<br>
171
					DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
172
				</div>
173
			</div>
174
		</div>
175
	</section>
176
</body>
177
</html>