Subversion-Projekte lars-tiefland.cienc

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
8 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>FixedColumns example - Server-side processing</title>
9
	<link rel="stylesheet" type="text/css" href="../../../media/css/jquery.dataTables.css">
10
	<link rel="stylesheet" type="text/css" href="../css/dataTables.fixedColumns.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
	/* Ensure that the demo table scrolls */
16
	th, td { white-space: nowrap; }
17
	div.dataTables_wrapper {
18
		width: 600px;
19
		margin: 0 auto;
20
	}
21
 
22
	/* Lots of padding for the cells as SSP has limited data in the demo */
23
	th,
24
	td {
25
		padding-left: 40px !important;
26
		padding-right: 40px !important;
27
	}
28
 
29
	</style>
30
	<script type="text/javascript" language="javascript" src="../../../media/js/jquery.js"></script>
31
	<script type="text/javascript" language="javascript" src="../../../media/js/jquery.dataTables.js"></script>
32
	<script type="text/javascript" language="javascript" src="../js/dataTables.fixedColumns.js"></script>
33
	<script type="text/javascript" language="javascript" src="../../../examples/resources/syntax/shCore.js"></script>
34
	<script type="text/javascript" language="javascript" src="../../../examples/resources/demo.js"></script>
35
	<script type="text/javascript" language="javascript" class="init">
36
 
37
 
38
$(document).ready(function() {
39
	var table = $('#example').DataTable( {
40
		scrollY:        "300px",
41
		scrollX:        true,
42
		scrollCollapse: true,
43
		ajax: "../../../examples/server_side/scripts/server_processing.php",
44
		serverSide: true
45
	} );
46
	new $.fn.dataTable.FixedColumns( table );
47
} );
48
 
49
 
50
	</script>
51
</head>
52
 
53
<body class="dt-example">
54
	<div class="container">
55
		<section>
56
			<h1>FixedColumns example <span>Server-side processing</span></h1>
57
 
58
			<div class="info">
59
				<p>This example shows how FixedColumns can be used with server-side processing in DataTables to cope with very large tables. No special considerations are
60
				required, just initialise FixedColumns as you normally would!</p>
61
 
62
				<p>Note that the table width is constrained in this example to allow scrolling to occur as the server-side processing data set has a limited number of columns in
63
				this demo!</p>
64
			</div>
65
 
66
			<table id="example" class="stripe row-border order-column" cellspacing="0" width="100%">
67
				<thead>
68
					<tr>
69
						<th>Name</th>
70
						<th>Position</th>
71
						<th>Office</th>
72
						<th>Extn.</th>
73
						<th>Start date</th>
74
						<th>Salary</th>
75
					</tr>
76
				</thead>
77
 
78
				<tfoot>
79
					<tr>
80
						<th>Name</th>
81
						<th>Position</th>
82
						<th>Office</th>
83
						<th>Extn.</th>
84
						<th>Start date</th>
85
						<th>Salary</th>
86
					</tr>
87
				</tfoot>
88
			</table>
89
 
90
			<ul class="tabs">
91
				<li class="active">Javascript</li>
92
				<li>HTML</li>
93
				<li>CSS</li>
94
				<li>Ajax</li>
95
				<li>Server-side script</li>
96
			</ul>
97
 
98
			<div class="tabs">
99
				<div class="js">
100
					<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
101
	var table = $('#example').DataTable( {
102
		scrollY:        &quot;300px&quot;,
103
		scrollX:        true,
104
		scrollCollapse: true,
105
		ajax: &quot;../../../examples/server_side/scripts/server_processing.php&quot;,
106
		serverSide: true
107
	} );
108
	new $.fn.dataTable.FixedColumns( table );
109
} );</code>
110
 
111
					<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
112
 
113
					<ul>
114
						<li><a href="../../../media/js/jquery.js">../../../media/js/jquery.js</a></li>
115
						<li><a href="../../../media/js/jquery.dataTables.js">../../../media/js/jquery.dataTables.js</a></li>
116
						<li><a href="../js/dataTables.fixedColumns.js">../js/dataTables.fixedColumns.js</a></li>
117
					</ul>
118
				</div>
119
 
120
				<div class="table">
121
					<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
122
				</div>
123
 
124
				<div class="css">
125
					<div>
126
						<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
127
						additional CSS used is shown below:</p><code class="multiline language-css">/* Ensure that the demo table scrolls */
128
	th, td { white-space: nowrap; }
129
	div.dataTables_wrapper {
130
		width: 600px;
131
		margin: 0 auto;
132
	}
133
 
134
	/* Lots of padding for the cells as SSP has limited data in the demo */
135
	th,
136
	td {
137
		padding-left: 40px !important;
138
		padding-right: 40px !important;
139
	}</code>
140
					</div>
141
 
142
					<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
143
 
144
					<ul>
145
						<li><a href="../../../media/css/jquery.dataTables.css">../../../media/css/jquery.dataTables.css</a></li>
146
						<li><a href="../css/dataTables.fixedColumns.css">../css/dataTables.fixedColumns.css</a></li>
147
					</ul>
148
				</div>
149
 
150
				<div class="ajax">
151
					<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
152
					loaded.</p>
153
				</div>
154
 
155
				<div class="php">
156
					<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
157
					processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables
158
					documentation</a>.</p>
159
				</div>
160
			</div>
161
		</section>
162
	</div>
163
 
164
	<section>
165
		<div class="footer">
166
			<div class="gradient"></div>
167
 
168
			<div class="liner">
169
				<h2>Other examples</h2>
170
 
171
				<div class="toc">
172
					<div class="toc-group">
173
						<h3><a href="./index.html">Examples</a></h3>
174
						<ul class="toc active">
175
							<li><a href="./left_right_columns.html">Left and right fixed columns</a></li>
176
							<li><a href="./simple.html">Basic initialisation</a></li>
177
							<li><a href="./two_columns.html">Multiple fixed columns</a></li>
178
							<li><a href="./right_column.html">Right column only</a></li>
179
							<li><a href="./rowspan.html">Complex headers</a></li>
180
							<li><a href="./colvis.html">ColVis integration</a></li>
181
							<li class="active"><a href="./server-side-processing.html">Server-side processing</a></li>
182
							<li><a href="./css_size.html">CSS row sizing</a></li>
183
							<li><a href="./size_fixed.html">Assigned column width</a></li>
184
							<li><a href="./size_fluid.html">Fluid column width</a></li>
185
							<li><a href="./col_filter.html">Individual column filtering</a></li>
186
							<li><a href="./bootstrap.html">Bootstrap</a></li>
187
							<li><a href="./index_column.html">Index column</a></li>
188
						</ul>
189
					</div>
190
				</div>
191
 
192
				<div class="epilogue">
193
					<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
194
					Additionally, there are a wide range of <a href="http://www.datatables.net/extras">extras</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a>
195
					which extend the capabilities of DataTables.</p>
196
 
197
					<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &#169; 2007-2015<br>
198
					DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
199
				</div>
200
			</div>
201
		</div>
202
	</section>
203
</body>
204
</html>