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">
8 <title>TableTools example - Row selection - multi-row select
</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">
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">
25 $(document).ready(function() {
26 $('#example').DataTable( {
27 dom: 'T<
"clear">lfrtip',
29 "sRowSelect":
"multi",
30 "aButtons": [
"select_all",
"select_none" ]
39 <body class=
"dt-example">
40 <div class=
"container">
42 <h1>TableTools example
<span>Row selection - multi-row select
</span></h1>
45 <p>As well as providing a button toolbar, TableTools provides everything needed to have selectable rows in the table. TableTools has four row selection modes of
49 <li><code>none
</code> - Default, where no user row selection options are available
</li>
50 <li><code>single
</code> - A single row can be selected
</li>
51 <li><code>multi
</code> - Multiple rows can be selected simply by clicking on the rows
</li>
52 <li><code>os
</code> - Operating System like selection where you can use the shift and ctrl / cmd keys on your keyboard to add / remove rows from the
56 <p>This example shows the
<code>multi
</code> select option. There are also a number of
<a href=
"http://datatables.net/extras/tabletools/buttons">pre-defined
57 buttons
</a> to provide functions such as select-all and select-none, as shown in this example.
</p>
60 <table id=
"example" class=
"display" cellspacing=
"0" width=
"100%">
86 <td>System Architect
</td>
93 <td>Garrett Winters
</td>
102 <td>Junior Technical Author
</td>
103 <td>San Francisco
</td>
109 <td>Cedric Kelly
</td>
110 <td>Senior Javascript Developer
</td>
125 <td>Brielle Williamson
</td>
126 <td>Integration Specialist
</td>
133 <td>Herrod Chandler
</td>
134 <td>Sales Assistant
</td>
135 <td>San Francisco
</td>
141 <td>Rhona Davidson
</td>
142 <td>Integration Specialist
</td>
149 <td>Colleen Hurst
</td>
150 <td>Javascript Developer
</td>
151 <td>San Francisco
</td>
158 <td>Software Engineer
</td>
166 <td>Office Manager
</td>
174 <td>Support Lead
</td>
181 <td>Charde Marshall
</td>
182 <td>Regional Director
</td>
183 <td>San Francisco
</td>
189 <td>Haley Kennedy
</td>
190 <td>Senior Marketing Designer
</td>
197 <td>Tatyana Fitzpatrick
</td>
198 <td>Regional Director
</td>
205 <td>Michael Silva
</td>
206 <td>Marketing Designer
</td>
214 <td>Chief Financial Officer (CFO)
</td>
221 <td>Gloria Little
</td>
222 <td>Systems Administrator
</td>
229 <td>Bradley Greer
</td>
230 <td>Software Engineer
</td>
238 <td>Personnel Lead
</td>
245 <td>Jenette Caldwell
</td>
246 <td>Development Lead
</td>
254 <td>Chief Marketing Officer (CMO)
</td>
261 <td>Caesar Vance
</td>
262 <td>Pre-Sales Support
</td>
269 <td>Doris Wilder
</td>
270 <td>Sales Assistant
</td>
277 <td>Angelica Ramos
</td>
278 <td>Chief Executive Officer (CEO)
</td>
293 <td>Jennifer Chang
</td>
294 <td>Regional Director
</td>
301 <td>Brenden Wagner
</td>
302 <td>Software Engineer
</td>
303 <td>San Francisco
</td>
310 <td>Chief Operating Officer (COO)
</td>
311 <td>San Francisco
</td>
318 <td>Regional Marketing
</td>
325 <td>Michelle House
</td>
326 <td>Integration Specialist
</td>
341 <td>Prescott Bartlett
</td>
342 <td>Technical Author
</td>
349 <td>Gavin Cortez
</td>
351 <td>San Francisco
</td>
357 <td>Martena Mccray
</td>
358 <td>Post-Sales support
</td>
365 <td>Unity Butler
</td>
366 <td>Marketing Designer
</td>
367 <td>San Francisco
</td>
373 <td>Howard Hatfield
</td>
374 <td>Office Manager
</td>
375 <td>San Francisco
</td>
381 <td>Hope Fuentes
</td>
383 <td>San Francisco
</td>
389 <td>Vivian Harrell
</td>
390 <td>Financial Controller
</td>
391 <td>San Francisco
</td>
397 <td>Timothy Mooney
</td>
398 <td>Office Manager
</td>
405 <td>Jackson Bradshaw
</td>
413 <td>Olivia Liang
</td>
414 <td>Support Engineer
</td>
422 <td>Software Engineer
</td>
429 <td>Sakura Yamamoto
</td>
430 <td>Support Engineer
</td>
445 <td>Finn Camacho
</td>
446 <td>Support Engineer
</td>
447 <td>San Francisco
</td>
453 <td>Serge Baldwin
</td>
454 <td>Data Coordinator
</td>
461 <td>Zenaida Frank
</td>
462 <td>Software Engineer
</td>
469 <td>Zorita Serrano
</td>
470 <td>Software Engineer
</td>
471 <td>San Francisco
</td>
477 <td>Jennifer Acosta
</td>
478 <td>Junior Javascript Developer
</td>
485 <td>Cara Stevens
</td>
486 <td>Sales Assistant
</td>
493 <td>Hermione Butler
</td>
494 <td>Regional Director
</td>
502 <td>Systems Administrator
</td>
509 <td>Jonas Alexander
</td>
511 <td>San Francisco
</td>
518 <td>Regional Director
</td>
525 <td>Michael Bruce
</td>
526 <td>Javascript Developer
</td>
533 <td>Donna Snider
</td>
534 <td>Customer Support
</td>
544 <li class=
"active">Javascript
</li>
548 <li>Server-side script
</li>
553 <p>The Javascript shown below is used to initialise the table shown in this example:
</p><code class=
"multiline language-js">$(document).ready(function() {
554 $('#example').DataTable( {
555 dom: 'T
<"clear
">lfrtip',
557 "sRowSelect
":
"multi
",
558 "aButtons
": [
"select_all
",
"select_none
" ]
563 <p>In addition to the above code, the following Javascript library files are loaded for use in this example:
</p>
566 <li><a href=
"../../../media/js/jquery.js">../../../media/js/jquery.js
</a></li>
567 <li><a href=
"../../../media/js/jquery.dataTables.js">../../../media/js/jquery.dataTables.js
</a></li>
568 <li><a href=
"../js/dataTables.tableTools.js">../js/dataTables.tableTools.js
</a></li>
573 <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:
</p>
578 <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
579 additional CSS used is shown below:
</p><code class=
"multiline language-css"></code>
582 <p>The following CSS library files are loaded for use in this example to provide the styling of the table:
</p>
585 <li><a href=
"../../../media/css/jquery.dataTables.css">../../../media/css/jquery.dataTables.css
</a></li>
586 <li><a href=
"../css/dataTables.tableTools.css">../css/dataTables.tableTools.css
</a></li>
591 <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
596 <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
597 processing scripts can be written in any language, using
<a href=
"//datatables.net/manual/server-side">the protocol described in the DataTables
598 documentation
</a>.
</p>
606 <div class=
"gradient"></div>
609 <h2>Other examples
</h2>
612 <div class=
"toc-group">
613 <h3><a href=
"./index.html">Examples
</a></h3>
614 <ul class=
"toc active">
615 <li><a href=
"./simple.html">Basic initialisation
</a></li>
616 <li><a href=
"./swf_path.html">Setting the SWF path
</a></li>
617 <li><a href=
"./new_init.html">Initialisation with `new`
</a></li>
618 <li><a href=
"./defaults.html">Defaults
</a></li>
619 <li><a href=
"./select_single.html">Row selection - single row select
</a></li>
620 <li class=
"active"><a href=
"./select_multi.html">Row selection - multi-row select
</a></li>
621 <li><a href=
"./select_os.html">Row selection - operating system style
</a></li>
622 <li><a href=
"./select_column.html">Row selection - row selector on specific cells
</a></li>
623 <li><a href=
"./multiple_tables.html">Multiple tables
</a></li>
624 <li><a href=
"./multi_instance.html">Multiple toolbars
</a></li>
625 <li><a href=
"./collection.html">Button collections
</a></li>
626 <li><a href=
"./plug-in.html">Plug-in button types
</a></li>
627 <li><a href=
"./button_text.html">Custom button text
</a></li>
628 <li><a href=
"./alter_buttons.html">Button arrangement
</a></li>
629 <li><a href=
"./ajax.html">Ajax loaded data
</a></li>
630 <li><a href=
"./pdf_message.html">PDF message
</a></li>
631 <li><a href=
"./bootstrap.html">Bootstrap styling
</a></li>
632 <li><a href=
"./jqueryui.html">jQuery UI styling
</a></li>
637 <div class=
"epilogue">
638 <p>Please refer to the
<a href=
"http://www.datatables.net">DataTables documentation
</a> for full information about its API properties and methods.
<br>
639 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>
640 which extend the capabilities of DataTables.
</p>
642 <p class=
"copyright">DataTables designed and created by
<a href=
"http://www.sprymedia.co.uk">SpryMedia Ltd
</a> © 2007-
2015<br>
643 DataTables is licensed under the
<a href=
"http://www.datatables.net/mit">MIT license
</a>.
</p>