| 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>Buttons example - Group selection</title>
|
|
|
9 |
<link rel="stylesheet" type="text/css" href="../../../../media/css/jquery.dataTables.css">
|
|
|
10 |
<link rel="stylesheet" type="text/css" href="../../css/buttons.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.buttons.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 |
|
|
|
25 |
$(document).ready(function() {
|
|
|
26 |
var table = $('#example').DataTable();
|
|
|
27 |
|
|
|
28 |
new $.fn.dataTable.Buttons( table, {
|
|
|
29 |
buttons: [
|
|
|
30 |
{
|
|
|
31 |
text: 'Button 1',
|
|
|
32 |
action: function ( e, dt, node, conf ) {
|
|
|
33 |
console.log( 'Button 1 clicked on' );
|
|
|
34 |
}
|
|
|
35 |
},
|
|
|
36 |
{
|
|
|
37 |
text: 'Button 2',
|
|
|
38 |
action: function ( e, dt, node, conf ) {
|
|
|
39 |
console.log( 'Button 2 clicked on' );
|
|
|
40 |
}
|
|
|
41 |
}
|
|
|
42 |
]
|
|
|
43 |
} );
|
|
|
44 |
|
|
|
45 |
table.buttons( 0, null ).container().prependTo(
|
|
|
46 |
table.table().container()
|
|
|
47 |
);
|
|
|
48 |
} );
|
|
|
49 |
|
|
|
50 |
|
|
|
51 |
|
|
|
52 |
</script>
|
|
|
53 |
</head>
|
|
|
54 |
|
|
|
55 |
<body class="dt-example">
|
|
|
56 |
<div class="container">
|
|
|
57 |
<section>
|
|
|
58 |
<h1>Buttons example <span>Group selection</span></h1>
|
|
|
59 |
|
|
|
60 |
<div class="info">
|
|
|
61 |
<p>Multiple button sets can coexist together sharing the same DataTable as a host. When using the API you need the ability to select one, or more, of those groups,
|
|
|
62 |
and thus the buttons in them to be able to take whatever action is required. This is provided through the <a href=
|
|
|
63 |
"//datatables.net/reference/type/button-group-selector"><code class="type" title="Javascript parameter type">button-group-selector</code></a> data type of the
|
|
|
64 |
<a href="//datatables.net/reference/api/button()"><code class="api" title="Buttons API method">button()</code></a> and <a href=
|
|
|
65 |
"//datatables.net/reference/api/buttons()"><code class="api" title="Buttons API method">buttons()</code></a> methods.</p>
|
|
|
66 |
|
|
|
67 |
<p>The group selector, and the individual button selector (<a href="//datatables.net/reference/type/button-selector"><code class="type" title=
|
|
|
68 |
"Javascript parameter type">button-selector</code></a>) give the ability to select any button or buttons in any group or groups of buttons. Actions can also be
|
|
|
69 |
taken on a whole group of buttons.</p>
|
|
|
70 |
|
|
|
71 |
<p>This example shows Buttons being constructed using the <code>new $.fn.dataTable.Buttons</code> construct and then the container node that holds all of the
|
|
|
72 |
created buttons obtained via the <a href="//datatables.net/reference/api/buttons().container()"><code class="api" title=
|
|
|
73 |
"Buttons API method">buttons().container()</code></a> method. Note that the function is called with two parameters: <code>0</code> and <code>null</code>. The
|
|
|
74 |
<code>0</code> is the <a href="//datatables.net/reference/type/button-group-selector"><code class="type" title=
|
|
|
75 |
"Javascript parameter type">button-group-selector</code></a> option (i.e. select BUttons instance 0) and the second parameter is the <a href=
|
|
|
76 |
"//datatables.net/reference/type/button-selector"><code class="type" title="Javascript parameter type">button-selector</code></a> option. This is important as if a
|
|
|
77 |
single parameter is passed into the <a href="//datatables.net/reference/api/button()"><code class="api" title="Buttons API method">button()</code></a> or <a href=
|
|
|
78 |
"//datatables.net/reference/api/buttons()"><code class="api" title="Buttons API method">buttons()</code></a> methods it is treated as a <a href=
|
|
|
79 |
"//datatables.net/reference/type/button-selector"><code class="type" title="Javascript parameter type">button-selector</code></a>.</p>
|
|
|
80 |
</div>
|
|
|
81 |
|
|
|
82 |
<table id="example" class="display" cellspacing="0" width="100%">
|
|
|
83 |
<thead>
|
|
|
84 |
<tr>
|
|
|
85 |
<th>Name</th>
|
|
|
86 |
<th>Position</th>
|
|
|
87 |
<th>Office</th>
|
|
|
88 |
<th>Age</th>
|
|
|
89 |
<th>Start date</th>
|
|
|
90 |
<th>Salary</th>
|
|
|
91 |
</tr>
|
|
|
92 |
</thead>
|
|
|
93 |
|
|
|
94 |
<tfoot>
|
|
|
95 |
<tr>
|
|
|
96 |
<th>Name</th>
|
|
|
97 |
<th>Position</th>
|
|
|
98 |
<th>Office</th>
|
|
|
99 |
<th>Age</th>
|
|
|
100 |
<th>Start date</th>
|
|
|
101 |
<th>Salary</th>
|
|
|
102 |
</tr>
|
|
|
103 |
</tfoot>
|
|
|
104 |
|
|
|
105 |
<tbody>
|
|
|
106 |
<tr>
|
|
|
107 |
<td>Tiger Nixon</td>
|
|
|
108 |
<td>System Architect</td>
|
|
|
109 |
<td>Edinburgh</td>
|
|
|
110 |
<td>61</td>
|
|
|
111 |
<td>2011/04/25</td>
|
|
|
112 |
<td>$320,800</td>
|
|
|
113 |
</tr>
|
|
|
114 |
<tr>
|
|
|
115 |
<td>Garrett Winters</td>
|
|
|
116 |
<td>Accountant</td>
|
|
|
117 |
<td>Tokyo</td>
|
|
|
118 |
<td>63</td>
|
|
|
119 |
<td>2011/07/25</td>
|
|
|
120 |
<td>$170,750</td>
|
|
|
121 |
</tr>
|
|
|
122 |
<tr>
|
|
|
123 |
<td>Ashton Cox</td>
|
|
|
124 |
<td>Junior Technical Author</td>
|
|
|
125 |
<td>San Francisco</td>
|
|
|
126 |
<td>66</td>
|
|
|
127 |
<td>2009/01/12</td>
|
|
|
128 |
<td>$86,000</td>
|
|
|
129 |
</tr>
|
|
|
130 |
<tr>
|
|
|
131 |
<td>Cedric Kelly</td>
|
|
|
132 |
<td>Senior Javascript Developer</td>
|
|
|
133 |
<td>Edinburgh</td>
|
|
|
134 |
<td>22</td>
|
|
|
135 |
<td>2012/03/29</td>
|
|
|
136 |
<td>$433,060</td>
|
|
|
137 |
</tr>
|
|
|
138 |
<tr>
|
|
|
139 |
<td>Airi Satou</td>
|
|
|
140 |
<td>Accountant</td>
|
|
|
141 |
<td>Tokyo</td>
|
|
|
142 |
<td>33</td>
|
|
|
143 |
<td>2008/11/28</td>
|
|
|
144 |
<td>$162,700</td>
|
|
|
145 |
</tr>
|
|
|
146 |
<tr>
|
|
|
147 |
<td>Brielle Williamson</td>
|
|
|
148 |
<td>Integration Specialist</td>
|
|
|
149 |
<td>New York</td>
|
|
|
150 |
<td>61</td>
|
|
|
151 |
<td>2012/12/02</td>
|
|
|
152 |
<td>$372,000</td>
|
|
|
153 |
</tr>
|
|
|
154 |
<tr>
|
|
|
155 |
<td>Herrod Chandler</td>
|
|
|
156 |
<td>Sales Assistant</td>
|
|
|
157 |
<td>San Francisco</td>
|
|
|
158 |
<td>59</td>
|
|
|
159 |
<td>2012/08/06</td>
|
|
|
160 |
<td>$137,500</td>
|
|
|
161 |
</tr>
|
|
|
162 |
<tr>
|
|
|
163 |
<td>Rhona Davidson</td>
|
|
|
164 |
<td>Integration Specialist</td>
|
|
|
165 |
<td>Tokyo</td>
|
|
|
166 |
<td>55</td>
|
|
|
167 |
<td>2010/10/14</td>
|
|
|
168 |
<td>$327,900</td>
|
|
|
169 |
</tr>
|
|
|
170 |
<tr>
|
|
|
171 |
<td>Colleen Hurst</td>
|
|
|
172 |
<td>Javascript Developer</td>
|
|
|
173 |
<td>San Francisco</td>
|
|
|
174 |
<td>39</td>
|
|
|
175 |
<td>2009/09/15</td>
|
|
|
176 |
<td>$205,500</td>
|
|
|
177 |
</tr>
|
|
|
178 |
<tr>
|
|
|
179 |
<td>Sonya Frost</td>
|
|
|
180 |
<td>Software Engineer</td>
|
|
|
181 |
<td>Edinburgh</td>
|
|
|
182 |
<td>23</td>
|
|
|
183 |
<td>2008/12/13</td>
|
|
|
184 |
<td>$103,600</td>
|
|
|
185 |
</tr>
|
|
|
186 |
<tr>
|
|
|
187 |
<td>Jena Gaines</td>
|
|
|
188 |
<td>Office Manager</td>
|
|
|
189 |
<td>London</td>
|
|
|
190 |
<td>30</td>
|
|
|
191 |
<td>2008/12/19</td>
|
|
|
192 |
<td>$90,560</td>
|
|
|
193 |
</tr>
|
|
|
194 |
<tr>
|
|
|
195 |
<td>Quinn Flynn</td>
|
|
|
196 |
<td>Support Lead</td>
|
|
|
197 |
<td>Edinburgh</td>
|
|
|
198 |
<td>22</td>
|
|
|
199 |
<td>2013/03/03</td>
|
|
|
200 |
<td>$342,000</td>
|
|
|
201 |
</tr>
|
|
|
202 |
<tr>
|
|
|
203 |
<td>Charde Marshall</td>
|
|
|
204 |
<td>Regional Director</td>
|
|
|
205 |
<td>San Francisco</td>
|
|
|
206 |
<td>36</td>
|
|
|
207 |
<td>2008/10/16</td>
|
|
|
208 |
<td>$470,600</td>
|
|
|
209 |
</tr>
|
|
|
210 |
<tr>
|
|
|
211 |
<td>Haley Kennedy</td>
|
|
|
212 |
<td>Senior Marketing Designer</td>
|
|
|
213 |
<td>London</td>
|
|
|
214 |
<td>43</td>
|
|
|
215 |
<td>2012/12/18</td>
|
|
|
216 |
<td>$313,500</td>
|
|
|
217 |
</tr>
|
|
|
218 |
<tr>
|
|
|
219 |
<td>Tatyana Fitzpatrick</td>
|
|
|
220 |
<td>Regional Director</td>
|
|
|
221 |
<td>London</td>
|
|
|
222 |
<td>19</td>
|
|
|
223 |
<td>2010/03/17</td>
|
|
|
224 |
<td>$385,750</td>
|
|
|
225 |
</tr>
|
|
|
226 |
<tr>
|
|
|
227 |
<td>Michael Silva</td>
|
|
|
228 |
<td>Marketing Designer</td>
|
|
|
229 |
<td>London</td>
|
|
|
230 |
<td>66</td>
|
|
|
231 |
<td>2012/11/27</td>
|
|
|
232 |
<td>$198,500</td>
|
|
|
233 |
</tr>
|
|
|
234 |
<tr>
|
|
|
235 |
<td>Paul Byrd</td>
|
|
|
236 |
<td>Chief Financial Officer (CFO)</td>
|
|
|
237 |
<td>New York</td>
|
|
|
238 |
<td>64</td>
|
|
|
239 |
<td>2010/06/09</td>
|
|
|
240 |
<td>$725,000</td>
|
|
|
241 |
</tr>
|
|
|
242 |
<tr>
|
|
|
243 |
<td>Gloria Little</td>
|
|
|
244 |
<td>Systems Administrator</td>
|
|
|
245 |
<td>New York</td>
|
|
|
246 |
<td>59</td>
|
|
|
247 |
<td>2009/04/10</td>
|
|
|
248 |
<td>$237,500</td>
|
|
|
249 |
</tr>
|
|
|
250 |
<tr>
|
|
|
251 |
<td>Bradley Greer</td>
|
|
|
252 |
<td>Software Engineer</td>
|
|
|
253 |
<td>London</td>
|
|
|
254 |
<td>41</td>
|
|
|
255 |
<td>2012/10/13</td>
|
|
|
256 |
<td>$132,000</td>
|
|
|
257 |
</tr>
|
|
|
258 |
<tr>
|
|
|
259 |
<td>Dai Rios</td>
|
|
|
260 |
<td>Personnel Lead</td>
|
|
|
261 |
<td>Edinburgh</td>
|
|
|
262 |
<td>35</td>
|
|
|
263 |
<td>2012/09/26</td>
|
|
|
264 |
<td>$217,500</td>
|
|
|
265 |
</tr>
|
|
|
266 |
<tr>
|
|
|
267 |
<td>Jenette Caldwell</td>
|
|
|
268 |
<td>Development Lead</td>
|
|
|
269 |
<td>New York</td>
|
|
|
270 |
<td>30</td>
|
|
|
271 |
<td>2011/09/03</td>
|
|
|
272 |
<td>$345,000</td>
|
|
|
273 |
</tr>
|
|
|
274 |
<tr>
|
|
|
275 |
<td>Yuri Berry</td>
|
|
|
276 |
<td>Chief Marketing Officer (CMO)</td>
|
|
|
277 |
<td>New York</td>
|
|
|
278 |
<td>40</td>
|
|
|
279 |
<td>2009/06/25</td>
|
|
|
280 |
<td>$675,000</td>
|
|
|
281 |
</tr>
|
|
|
282 |
<tr>
|
|
|
283 |
<td>Caesar Vance</td>
|
|
|
284 |
<td>Pre-Sales Support</td>
|
|
|
285 |
<td>New York</td>
|
|
|
286 |
<td>21</td>
|
|
|
287 |
<td>2011/12/12</td>
|
|
|
288 |
<td>$106,450</td>
|
|
|
289 |
</tr>
|
|
|
290 |
<tr>
|
|
|
291 |
<td>Doris Wilder</td>
|
|
|
292 |
<td>Sales Assistant</td>
|
|
|
293 |
<td>Sidney</td>
|
|
|
294 |
<td>23</td>
|
|
|
295 |
<td>2010/09/20</td>
|
|
|
296 |
<td>$85,600</td>
|
|
|
297 |
</tr>
|
|
|
298 |
<tr>
|
|
|
299 |
<td>Angelica Ramos</td>
|
|
|
300 |
<td>Chief Executive Officer (CEO)</td>
|
|
|
301 |
<td>London</td>
|
|
|
302 |
<td>47</td>
|
|
|
303 |
<td>2009/10/09</td>
|
|
|
304 |
<td>$1,200,000</td>
|
|
|
305 |
</tr>
|
|
|
306 |
<tr>
|
|
|
307 |
<td>Gavin Joyce</td>
|
|
|
308 |
<td>Developer</td>
|
|
|
309 |
<td>Edinburgh</td>
|
|
|
310 |
<td>42</td>
|
|
|
311 |
<td>2010/12/22</td>
|
|
|
312 |
<td>$92,575</td>
|
|
|
313 |
</tr>
|
|
|
314 |
<tr>
|
|
|
315 |
<td>Jennifer Chang</td>
|
|
|
316 |
<td>Regional Director</td>
|
|
|
317 |
<td>Singapore</td>
|
|
|
318 |
<td>28</td>
|
|
|
319 |
<td>2010/11/14</td>
|
|
|
320 |
<td>$357,650</td>
|
|
|
321 |
</tr>
|
|
|
322 |
<tr>
|
|
|
323 |
<td>Brenden Wagner</td>
|
|
|
324 |
<td>Software Engineer</td>
|
|
|
325 |
<td>San Francisco</td>
|
|
|
326 |
<td>28</td>
|
|
|
327 |
<td>2011/06/07</td>
|
|
|
328 |
<td>$206,850</td>
|
|
|
329 |
</tr>
|
|
|
330 |
<tr>
|
|
|
331 |
<td>Fiona Green</td>
|
|
|
332 |
<td>Chief Operating Officer (COO)</td>
|
|
|
333 |
<td>San Francisco</td>
|
|
|
334 |
<td>48</td>
|
|
|
335 |
<td>2010/03/11</td>
|
|
|
336 |
<td>$850,000</td>
|
|
|
337 |
</tr>
|
|
|
338 |
<tr>
|
|
|
339 |
<td>Shou Itou</td>
|
|
|
340 |
<td>Regional Marketing</td>
|
|
|
341 |
<td>Tokyo</td>
|
|
|
342 |
<td>20</td>
|
|
|
343 |
<td>2011/08/14</td>
|
|
|
344 |
<td>$163,000</td>
|
|
|
345 |
</tr>
|
|
|
346 |
<tr>
|
|
|
347 |
<td>Michelle House</td>
|
|
|
348 |
<td>Integration Specialist</td>
|
|
|
349 |
<td>Sidney</td>
|
|
|
350 |
<td>37</td>
|
|
|
351 |
<td>2011/06/02</td>
|
|
|
352 |
<td>$95,400</td>
|
|
|
353 |
</tr>
|
|
|
354 |
<tr>
|
|
|
355 |
<td>Suki Burks</td>
|
|
|
356 |
<td>Developer</td>
|
|
|
357 |
<td>London</td>
|
|
|
358 |
<td>53</td>
|
|
|
359 |
<td>2009/10/22</td>
|
|
|
360 |
<td>$114,500</td>
|
|
|
361 |
</tr>
|
|
|
362 |
<tr>
|
|
|
363 |
<td>Prescott Bartlett</td>
|
|
|
364 |
<td>Technical Author</td>
|
|
|
365 |
<td>London</td>
|
|
|
366 |
<td>27</td>
|
|
|
367 |
<td>2011/05/07</td>
|
|
|
368 |
<td>$145,000</td>
|
|
|
369 |
</tr>
|
|
|
370 |
<tr>
|
|
|
371 |
<td>Gavin Cortez</td>
|
|
|
372 |
<td>Team Leader</td>
|
|
|
373 |
<td>San Francisco</td>
|
|
|
374 |
<td>22</td>
|
|
|
375 |
<td>2008/10/26</td>
|
|
|
376 |
<td>$235,500</td>
|
|
|
377 |
</tr>
|
|
|
378 |
<tr>
|
|
|
379 |
<td>Martena Mccray</td>
|
|
|
380 |
<td>Post-Sales support</td>
|
|
|
381 |
<td>Edinburgh</td>
|
|
|
382 |
<td>46</td>
|
|
|
383 |
<td>2011/03/09</td>
|
|
|
384 |
<td>$324,050</td>
|
|
|
385 |
</tr>
|
|
|
386 |
<tr>
|
|
|
387 |
<td>Unity Butler</td>
|
|
|
388 |
<td>Marketing Designer</td>
|
|
|
389 |
<td>San Francisco</td>
|
|
|
390 |
<td>47</td>
|
|
|
391 |
<td>2009/12/09</td>
|
|
|
392 |
<td>$85,675</td>
|
|
|
393 |
</tr>
|
|
|
394 |
<tr>
|
|
|
395 |
<td>Howard Hatfield</td>
|
|
|
396 |
<td>Office Manager</td>
|
|
|
397 |
<td>San Francisco</td>
|
|
|
398 |
<td>51</td>
|
|
|
399 |
<td>2008/12/16</td>
|
|
|
400 |
<td>$164,500</td>
|
|
|
401 |
</tr>
|
|
|
402 |
<tr>
|
|
|
403 |
<td>Hope Fuentes</td>
|
|
|
404 |
<td>Secretary</td>
|
|
|
405 |
<td>San Francisco</td>
|
|
|
406 |
<td>41</td>
|
|
|
407 |
<td>2010/02/12</td>
|
|
|
408 |
<td>$109,850</td>
|
|
|
409 |
</tr>
|
|
|
410 |
<tr>
|
|
|
411 |
<td>Vivian Harrell</td>
|
|
|
412 |
<td>Financial Controller</td>
|
|
|
413 |
<td>San Francisco</td>
|
|
|
414 |
<td>62</td>
|
|
|
415 |
<td>2009/02/14</td>
|
|
|
416 |
<td>$452,500</td>
|
|
|
417 |
</tr>
|
|
|
418 |
<tr>
|
|
|
419 |
<td>Timothy Mooney</td>
|
|
|
420 |
<td>Office Manager</td>
|
|
|
421 |
<td>London</td>
|
|
|
422 |
<td>37</td>
|
|
|
423 |
<td>2008/12/11</td>
|
|
|
424 |
<td>$136,200</td>
|
|
|
425 |
</tr>
|
|
|
426 |
<tr>
|
|
|
427 |
<td>Jackson Bradshaw</td>
|
|
|
428 |
<td>Director</td>
|
|
|
429 |
<td>New York</td>
|
|
|
430 |
<td>65</td>
|
|
|
431 |
<td>2008/09/26</td>
|
|
|
432 |
<td>$645,750</td>
|
|
|
433 |
</tr>
|
|
|
434 |
<tr>
|
|
|
435 |
<td>Olivia Liang</td>
|
|
|
436 |
<td>Support Engineer</td>
|
|
|
437 |
<td>Singapore</td>
|
|
|
438 |
<td>64</td>
|
|
|
439 |
<td>2011/02/03</td>
|
|
|
440 |
<td>$234,500</td>
|
|
|
441 |
</tr>
|
|
|
442 |
<tr>
|
|
|
443 |
<td>Bruno Nash</td>
|
|
|
444 |
<td>Software Engineer</td>
|
|
|
445 |
<td>London</td>
|
|
|
446 |
<td>38</td>
|
|
|
447 |
<td>2011/05/03</td>
|
|
|
448 |
<td>$163,500</td>
|
|
|
449 |
</tr>
|
|
|
450 |
<tr>
|
|
|
451 |
<td>Sakura Yamamoto</td>
|
|
|
452 |
<td>Support Engineer</td>
|
|
|
453 |
<td>Tokyo</td>
|
|
|
454 |
<td>37</td>
|
|
|
455 |
<td>2009/08/19</td>
|
|
|
456 |
<td>$139,575</td>
|
|
|
457 |
</tr>
|
|
|
458 |
<tr>
|
|
|
459 |
<td>Thor Walton</td>
|
|
|
460 |
<td>Developer</td>
|
|
|
461 |
<td>New York</td>
|
|
|
462 |
<td>61</td>
|
|
|
463 |
<td>2013/08/11</td>
|
|
|
464 |
<td>$98,540</td>
|
|
|
465 |
</tr>
|
|
|
466 |
<tr>
|
|
|
467 |
<td>Finn Camacho</td>
|
|
|
468 |
<td>Support Engineer</td>
|
|
|
469 |
<td>San Francisco</td>
|
|
|
470 |
<td>47</td>
|
|
|
471 |
<td>2009/07/07</td>
|
|
|
472 |
<td>$87,500</td>
|
|
|
473 |
</tr>
|
|
|
474 |
<tr>
|
|
|
475 |
<td>Serge Baldwin</td>
|
|
|
476 |
<td>Data Coordinator</td>
|
|
|
477 |
<td>Singapore</td>
|
|
|
478 |
<td>64</td>
|
|
|
479 |
<td>2012/04/09</td>
|
|
|
480 |
<td>$138,575</td>
|
|
|
481 |
</tr>
|
|
|
482 |
<tr>
|
|
|
483 |
<td>Zenaida Frank</td>
|
|
|
484 |
<td>Software Engineer</td>
|
|
|
485 |
<td>New York</td>
|
|
|
486 |
<td>63</td>
|
|
|
487 |
<td>2010/01/04</td>
|
|
|
488 |
<td>$125,250</td>
|
|
|
489 |
</tr>
|
|
|
490 |
<tr>
|
|
|
491 |
<td>Zorita Serrano</td>
|
|
|
492 |
<td>Software Engineer</td>
|
|
|
493 |
<td>San Francisco</td>
|
|
|
494 |
<td>56</td>
|
|
|
495 |
<td>2012/06/01</td>
|
|
|
496 |
<td>$115,000</td>
|
|
|
497 |
</tr>
|
|
|
498 |
<tr>
|
|
|
499 |
<td>Jennifer Acosta</td>
|
|
|
500 |
<td>Junior Javascript Developer</td>
|
|
|
501 |
<td>Edinburgh</td>
|
|
|
502 |
<td>43</td>
|
|
|
503 |
<td>2013/02/01</td>
|
|
|
504 |
<td>$75,650</td>
|
|
|
505 |
</tr>
|
|
|
506 |
<tr>
|
|
|
507 |
<td>Cara Stevens</td>
|
|
|
508 |
<td>Sales Assistant</td>
|
|
|
509 |
<td>New York</td>
|
|
|
510 |
<td>46</td>
|
|
|
511 |
<td>2011/12/06</td>
|
|
|
512 |
<td>$145,600</td>
|
|
|
513 |
</tr>
|
|
|
514 |
<tr>
|
|
|
515 |
<td>Hermione Butler</td>
|
|
|
516 |
<td>Regional Director</td>
|
|
|
517 |
<td>London</td>
|
|
|
518 |
<td>47</td>
|
|
|
519 |
<td>2011/03/21</td>
|
|
|
520 |
<td>$356,250</td>
|
|
|
521 |
</tr>
|
|
|
522 |
<tr>
|
|
|
523 |
<td>Lael Greer</td>
|
|
|
524 |
<td>Systems Administrator</td>
|
|
|
525 |
<td>London</td>
|
|
|
526 |
<td>21</td>
|
|
|
527 |
<td>2009/02/27</td>
|
|
|
528 |
<td>$103,500</td>
|
|
|
529 |
</tr>
|
|
|
530 |
<tr>
|
|
|
531 |
<td>Jonas Alexander</td>
|
|
|
532 |
<td>Developer</td>
|
|
|
533 |
<td>San Francisco</td>
|
|
|
534 |
<td>30</td>
|
|
|
535 |
<td>2010/07/14</td>
|
|
|
536 |
<td>$86,500</td>
|
|
|
537 |
</tr>
|
|
|
538 |
<tr>
|
|
|
539 |
<td>Shad Decker</td>
|
|
|
540 |
<td>Regional Director</td>
|
|
|
541 |
<td>Edinburgh</td>
|
|
|
542 |
<td>51</td>
|
|
|
543 |
<td>2008/11/13</td>
|
|
|
544 |
<td>$183,000</td>
|
|
|
545 |
</tr>
|
|
|
546 |
<tr>
|
|
|
547 |
<td>Michael Bruce</td>
|
|
|
548 |
<td>Javascript Developer</td>
|
|
|
549 |
<td>Singapore</td>
|
|
|
550 |
<td>29</td>
|
|
|
551 |
<td>2011/06/27</td>
|
|
|
552 |
<td>$183,000</td>
|
|
|
553 |
</tr>
|
|
|
554 |
<tr>
|
|
|
555 |
<td>Donna Snider</td>
|
|
|
556 |
<td>Customer Support</td>
|
|
|
557 |
<td>New York</td>
|
|
|
558 |
<td>27</td>
|
|
|
559 |
<td>2011/01/25</td>
|
|
|
560 |
<td>$112,000</td>
|
|
|
561 |
</tr>
|
|
|
562 |
</tbody>
|
|
|
563 |
</table>
|
|
|
564 |
|
|
|
565 |
<ul class="tabs">
|
|
|
566 |
<li class="active">Javascript</li>
|
|
|
567 |
<li>HTML</li>
|
|
|
568 |
<li>CSS</li>
|
|
|
569 |
<li>Ajax</li>
|
|
|
570 |
<li>Server-side script</li>
|
|
|
571 |
</ul>
|
|
|
572 |
|
|
|
573 |
<div class="tabs">
|
|
|
574 |
<div class="js">
|
|
|
575 |
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
|
|
|
576 |
var table = $('#example').DataTable();
|
|
|
577 |
|
|
|
578 |
new $.fn.dataTable.Buttons( table, {
|
|
|
579 |
buttons: [
|
|
|
580 |
{
|
|
|
581 |
text: 'Button 1',
|
|
|
582 |
action: function ( e, dt, node, conf ) {
|
|
|
583 |
console.log( 'Button 1 clicked on' );
|
|
|
584 |
}
|
|
|
585 |
},
|
|
|
586 |
{
|
|
|
587 |
text: 'Button 2',
|
|
|
588 |
action: function ( e, dt, node, conf ) {
|
|
|
589 |
console.log( 'Button 2 clicked on' );
|
|
|
590 |
}
|
|
|
591 |
}
|
|
|
592 |
]
|
|
|
593 |
} );
|
|
|
594 |
|
|
|
595 |
table.buttons( 0, null ).container().prependTo(
|
|
|
596 |
table.table().container()
|
|
|
597 |
);
|
|
|
598 |
} );</code>
|
|
|
599 |
|
|
|
600 |
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
|
|
|
601 |
|
|
|
602 |
<ul>
|
|
|
603 |
<li><a href="//code.jquery.com/jquery-1.11.3.min.js">//code.jquery.com/jquery-1.11.3.min.js</a></li>
|
|
|
604 |
<li><a href="../../../../media/js/jquery.dataTables.js">../../../../media/js/jquery.dataTables.js</a></li>
|
|
|
605 |
<li><a href="../../js/dataTables.buttons.js">../../js/dataTables.buttons.js</a></li>
|
|
|
606 |
</ul>
|
|
|
607 |
</div>
|
|
|
608 |
|
|
|
609 |
<div class="table">
|
|
|
610 |
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
|
|
|
611 |
</div>
|
|
|
612 |
|
|
|
613 |
<div class="css">
|
|
|
614 |
<div>
|
|
|
615 |
<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
|
|
|
616 |
additional CSS used is shown below:</p><code class="multiline language-css"></code>
|
|
|
617 |
</div>
|
|
|
618 |
|
|
|
619 |
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
|
|
|
620 |
|
|
|
621 |
<ul>
|
|
|
622 |
<li><a href="../../../../media/css/jquery.dataTables.css">../../../../media/css/jquery.dataTables.css</a></li>
|
|
|
623 |
<li><a href="../../css/buttons.dataTables.css">../../css/buttons.dataTables.css</a></li>
|
|
|
624 |
</ul>
|
|
|
625 |
</div>
|
|
|
626 |
|
|
|
627 |
<div class="ajax">
|
|
|
628 |
<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
|
|
|
629 |
loaded.</p>
|
|
|
630 |
</div>
|
|
|
631 |
|
|
|
632 |
<div class="php">
|
|
|
633 |
<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
|
|
|
634 |
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables
|
|
|
635 |
documentation</a>.</p>
|
|
|
636 |
</div>
|
|
|
637 |
</div>
|
|
|
638 |
</section>
|
|
|
639 |
</div>
|
|
|
640 |
|
|
|
641 |
<section>
|
|
|
642 |
<div class="footer">
|
|
|
643 |
<div class="gradient"></div>
|
|
|
644 |
|
|
|
645 |
<div class="liner">
|
|
|
646 |
<h2>Other examples</h2>
|
|
|
647 |
|
|
|
648 |
<div class="toc">
|
|
|
649 |
<div class="toc-group">
|
|
|
650 |
<h3><a href="../column_visibility/index.html">Column Visibility</a></h3>
|
|
|
651 |
<ul class="toc">
|
|
|
652 |
<li><a href="../column_visibility/simple.html">Basic column visibility</a></li>
|
|
|
653 |
<li><a href="../column_visibility/layout.html">Multi-column layout</a></li>
|
|
|
654 |
<li><a href="../column_visibility/text.html">Internationalisation</a></li>
|
|
|
655 |
<li><a href="../column_visibility/restore.html">Restore column visibility</a></li>
|
|
|
656 |
<li><a href="../column_visibility/columns.html">Select columns</a></li>
|
|
|
657 |
<li><a href="../column_visibility/columnsToggle.html">Visibility toggle buttons</a></li>
|
|
|
658 |
<li><a href="../column_visibility/columnGroups.html">Column groups</a></li>
|
|
|
659 |
</ul>
|
|
|
660 |
</div>
|
|
|
661 |
|
|
|
662 |
<div class="toc-group">
|
|
|
663 |
<h3><a href="../flash/index.html">Flash</a></h3>
|
|
|
664 |
<ul class="toc">
|
|
|
665 |
<li><a href="../flash/simple.html">Flash export buttons</a></li>
|
|
|
666 |
<li><a href="../flash/tsv.html">Tab separated values</a></li>
|
|
|
667 |
<li><a href="../flash/filename.html">File name</a></li>
|
|
|
668 |
<li><a href="../flash/copyi18n.html">Copy button internationalisation</a></li>
|
|
|
669 |
<li><a href="../flash/pdfMessage.html">PDF message</a></li>
|
|
|
670 |
<li><a href="../flash/pdfPage.html">Page size and orientation</a></li>
|
|
|
671 |
<li><a href="../flash/hidden.html">Hidden initialisation</a></li>
|
|
|
672 |
<li><a href="../flash/swfPath.html">SWF file location</a></li>
|
|
|
673 |
</ul>
|
|
|
674 |
</div>
|
|
|
675 |
|
|
|
676 |
<div class="toc-group">
|
|
|
677 |
<h3><a href="../html5/index.html">Html5</a></h3>
|
|
|
678 |
<ul class="toc">
|
|
|
679 |
<li><a href="../html5/simple.html">HTML5 export buttons</a></li>
|
|
|
680 |
<li><a href="../html5/tsv.html">Tab separated values</a></li>
|
|
|
681 |
<li><a href="../html5/filename.html">File name</a></li>
|
|
|
682 |
<li><a href="../html5/copyi18n.html">Copy button internationalisation</a></li>
|
|
|
683 |
<li><a href="../html5/pdfMessage.html">PDF message</a></li>
|
|
|
684 |
<li><a href="../html5/pdfPage.html">PDF page size and orientation</a></li>
|
|
|
685 |
<li><a href="../html5/pdfImage.html">PDF with image</a></li>
|
|
|
686 |
<li><a href="../html5/pdfOpen.html">PDF - open in new window</a></li>
|
|
|
687 |
<li><a href="../html5/columns.html">Column selectors</a></li>
|
|
|
688 |
</ul>
|
|
|
689 |
</div>
|
|
|
690 |
|
|
|
691 |
<div class="toc-group">
|
|
|
692 |
<h3><a href="../initialisation/index.html">Initialisation</a></h3>
|
|
|
693 |
<ul class="toc">
|
|
|
694 |
<li><a href="../initialisation/simple.html">Basic initialisation</a></li>
|
|
|
695 |
<li><a href="../initialisation/export.html">File export</a></li>
|
|
|
696 |
<li><a href="../initialisation/custom.html">Custom button</a></li>
|
|
|
697 |
<li><a href="../initialisation/className.html">Class names</a></li>
|
|
|
698 |
<li><a href="../initialisation/keys.html">Keyboard activation</a></li>
|
|
|
699 |
<li><a href="../initialisation/collections.html">Collections</a></li>
|
|
|
700 |
<li><a href="../initialisation/plugins.html">Plug-ins</a></li>
|
|
|
701 |
<li><a href="../initialisation/new.html">`new` initialisation</a></li>
|
|
|
702 |
<li><a href="../initialisation/multiple.html">Multiple button groups</a></li>
|
|
|
703 |
</ul>
|
|
|
704 |
</div>
|
|
|
705 |
|
|
|
706 |
<div class="toc-group">
|
|
|
707 |
<h3><a href="../print/index.html">Print</a></h3>
|
|
|
708 |
<ul class="toc">
|
|
|
709 |
<li><a href="../print/simple.html">Print button</a></li>
|
|
|
710 |
<li><a href="../print/message.html">Custom message</a></li>
|
|
|
711 |
<li><a href="../print/columns.html">Export options - column selector</a></li>
|
|
|
712 |
<li><a href="../print/select.html">Export options - row selector</a></li>
|
|
|
713 |
<li><a href="../print/autoPrint.html">Disable auto print</a></li>
|
|
|
714 |
<li><a href="../print/customisation.html">Customisation of the print view window</a></li>
|
|
|
715 |
</ul>
|
|
|
716 |
</div>
|
|
|
717 |
|
|
|
718 |
<div class="toc-group">
|
|
|
719 |
<h3><a href="../styling/index.html">Styling</a></h3>
|
|
|
720 |
<ul class="toc">
|
|
|
721 |
<li><a href="../styling/bootstrap.html">Bootstrap styling</a></li>
|
|
|
722 |
<li><a href="../styling/foundation.html">Foundation styling</a></li>
|
|
|
723 |
<li><a href="../styling/jqueryui.html">jQuery UI styling</a></li>
|
|
|
724 |
</ul>
|
|
|
725 |
</div>
|
|
|
726 |
|
|
|
727 |
<div class="toc-group">
|
|
|
728 |
<h3><a href="./index.html">API</a></h3>
|
|
|
729 |
<ul class="toc active">
|
|
|
730 |
<li><a href="./enable.html">Enable / disable</a></li>
|
|
|
731 |
<li><a href="./text.html">Dynamic text</a></li>
|
|
|
732 |
<li><a href="./addRemove.html">Adding and removing buttons dynamically</a></li>
|
|
|
733 |
<li class="active"><a href="./group.html">Group selection</a></li>
|
|
|
734 |
</ul>
|
|
|
735 |
</div>
|
|
|
736 |
</div>
|
|
|
737 |
|
|
|
738 |
<div class="epilogue">
|
|
|
739 |
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
|
|
|
740 |
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
|
|
|
741 |
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
|
|
|
742 |
|
|
|
743 |
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2015<br>
|
|
|
744 |
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
|
|
|
745 |
</div>
|
|
|
746 |
</div>
|
|
|
747 |
</div>
|
|
|
748 |
</section>
|
|
|
749 |
</body>
|
|
|
750 |
</html>
|