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