Subversion-Projekte lars-tiefland.faltradxxs.de

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
2 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>TableTools example - Ajax loaded data</title>
9
	<link rel="stylesheet" type="text/css" href="../../../media/css/jquery.dataTables.css">
10
	<link rel="stylesheet" type="text/css" href="../css/dataTables.tableTools.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="../../../media/js/jquery.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.tableTools.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
		dom: 'T<"clear">lfrtip',
27
		"ajax": "../../../../examples/ajax/data/objects.txt",
28
		"columns": [
29
			{ "data": "name" },
30
			{ "data": "position" },
31
			{ "data": "office" },
32
			{ "data": "extn" },
33
			{ "data": "start_date" },
34
			{ "data": "salary" }
35
		],
36
		deferRender: true
37
	} );
38
} );
39
 
40
 
41
	</script>
42
</head>
43
 
44
<body class="dt-example">
45
	<div class="container">
46
		<section>
47
			<h1>TableTools example <span>Ajax loaded data</span></h1>
48
 
49
			<div class="info">
50
				<p>This TableTools example shows DataTables using its ability to <a href=
51
				"//datatables.net/manual/data#Objects">Ajax load object based data</a> and operate in exactly the same
52
				manner as when the data is read directly from the document.</p>
53
			</div>
54
 
55
			<table id="example" class="display" cellspacing="0" width="100%">
56
				<thead>
57
					<tr>
58
						<th>Name</th>
59
						<th>Position</th>
60
						<th>Office</th>
61
						<th>Extn.</th>
62
						<th>Start date</th>
63
						<th>Salary</th>
64
					</tr>
65
				</thead>
66
 
67
				<tfoot>
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
				</tfoot>
77
			</table>
78
 
79
			<ul class="tabs">
80
				<li class="active">Javascript</li>
81
				<li>HTML</li>
82
				<li>CSS</li>
83
				<li>Ajax</li>
84
				<li>Server-side script</li>
85
			</ul>
86
 
87
			<div class="tabs">
88
				<div class="js">
89
					<p>The Javascript shown below is used to initialise the table shown in this
90
					example:</p><code class="multiline brush: js;">$(document).ready(function() {
91
	$('#example').DataTable( {
92
		dom: 'T&lt;&quot;clear&quot;&gt;lfrtip',
93
		&quot;ajax&quot;: &quot;../../../../examples/ajax/data/objects.txt&quot;,
94
		&quot;columns&quot;: [
95
			{ &quot;data&quot;: &quot;name&quot; },
96
			{ &quot;data&quot;: &quot;position&quot; },
97
			{ &quot;data&quot;: &quot;office&quot; },
98
			{ &quot;data&quot;: &quot;extn&quot; },
99
			{ &quot;data&quot;: &quot;start_date&quot; },
100
			{ &quot;data&quot;: &quot;salary&quot; }
101
		],
102
		deferRender: true
103
	} );
104
} );</code>
105
 
106
					<p>In addition to the above code, the following Javascript library files are loaded for use in this
107
					example:</p>
108
 
109
					<ul>
110
						<li><a href="../../../media/js/jquery.js">../../../media/js/jquery.js</a></li>
111
						<li><a href=
112
						"../../../media/js/jquery.dataTables.js">../../../media/js/jquery.dataTables.js</a></li>
113
						<li><a href="../js/dataTables.tableTools.js">../js/dataTables.tableTools.js</a></li>
114
					</ul>
115
				</div>
116
 
117
				<div class="table">
118
					<p>The HTML shown below is the raw HTML table element, before it has been enhanced by
119
					DataTables:</p>
120
				</div>
121
 
122
				<div class="css">
123
					<div>
124
						<p>This example uses a little bit of additional CSS beyond what is loaded from the library
125
						files (below), in order to correctly display the table. The additional CSS used is shown
126
						below:</p><code class="multiline brush: js;"></code>
127
					</div>
128
 
129
					<p>The following CSS library files are loaded for use in this example to provide the styling of the
130
					table:</p>
131
 
132
					<ul>
133
						<li><a href=
134
						"../../../media/css/jquery.dataTables.css">../../../media/css/jquery.dataTables.css</a></li>
135
						<li><a href="../css/dataTables.tableTools.css">../css/dataTables.tableTools.css</a></li>
136
					</ul>
137
				</div>
138
 
139
				<div class="ajax">
140
					<p>This table loads data by Ajax. The latest data that has been loaded is shown below. This data
141
					will update automatically as any additional data is loaded.</p>
142
				</div>
143
 
144
				<div class="php">
145
					<p>The script used to perform the server-side processing for this table is shown below. Please note
146
					that this is just an example script using PHP. Server-side processing scripts can be written in any
147
					language, using <a href="//datatables.net/manual/server-side">the protocol described in the
148
					DataTables documentation</a>.</p>
149
				</div>
150
			</div>
151
		</section>
152
	</div>
153
 
154
	<section>
155
		<div class="footer">
156
			<div class="gradient"></div>
157
 
158
			<div class="liner">
159
				<h2>Other examples</h2>
160
 
161
				<div class="toc">
162
					<div class="toc-group">
163
						<h3><a href="./index.html">Examples</a></h3>
164
						<ul class="toc active">
165
							<li><a href="./simple.html">Basic initialisation</a></li>
166
							<li><a href="./plug-in.html">Plug-in button types</a></li>
167
							<li><a href="./bootstrap.html">Bootstrap styling</a></li>
168
							<li><a href="./swf_path.html">Setting the SWF path</a></li>
169
							<li><a href="./new_init.html">Initialisation with `new`</a></li>
170
							<li><a href="./defaults.html">Defaults</a></li>
171
							<li><a href="./select_single.html">Row selection - single row select</a></li>
172
							<li><a href="./select_multi.html">Row selection - multi-row select</a></li>
173
							<li><a href="./select_os.html">Row selection - operating system style</a></li>
174
							<li><a href="./select_column.html">Row selection - row selector on specific cells</a></li>
175
							<li><a href="./multiple_tables.html">Multiple tables</a></li>
176
							<li><a href="./multi_instance.html">Multiple toolbars</a></li>
177
							<li><a href="./collection.html">Button collections</a></li>
178
							<li><a href="./button_text.html">Custom button text</a></li>
179
							<li><a href="./alter_buttons.html">Button arrangement</a></li>
180
							<li class="active"><a href="./ajax.html">Ajax loaded data</a></li>
181
							<li><a href="./pdf_message.html">PDF message</a></li>
182
							<li><a href="./jqueryui.html">jQuery UI styling</a></li>
183
						</ul>
184
					</div>
185
				</div>
186
 
187
				<div class="epilogue">
188
					<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full
189
					information about its API properties and methods.<br>
190
					Additionally, there are a wide range of <a href="http://www.datatables.net/extras">extras</a> and
191
					<a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of
192
					DataTables.</p>
193
 
194
					<p class="copyright">DataTables designed and created by <a href=
195
					"http://www.sprymedia.co.uk">SpryMedia Ltd</a> &#169; 2007-2014<br>
196
					DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
197
				</div>
198
			</div>
199
		</div>
200
	</section>
201
</body>
202
</html>