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