| 9 |
lars |
1 |
# Buttons
|
|
|
2 |
|
|
|
3 |
The Buttons extension for DataTables provides a common set of options, API methods and styling to display buttons on a page that will interact with a DataTable. Modules are also provided for data export, printing and column visibility control.
|
|
|
4 |
|
|
|
5 |
|
|
|
6 |
# Installation
|
|
|
7 |
|
|
|
8 |
To use Buttons the best way to obtain the software is to use the [DataTables downloader](//datatables.net/download). You can also include the individual files from the [DataTables CDN](//cdn.datatables.net). See the [documentation](http://datatables.net/extensions/buttons/) for full details.
|
|
|
9 |
|
|
|
10 |
|
|
|
11 |
# Basic usage
|
|
|
12 |
|
|
|
13 |
Buttons is initialised using the `buttons` option in the DataTables constructor, giving an array of the buttons that should be shown. Further options can be specified using this option as an object - see the documentation for details. For example:
|
|
|
14 |
|
|
|
15 |
```js
|
|
|
16 |
$(document).ready( function () {
|
|
|
17 |
$('#example').DataTable( {
|
|
|
18 |
buttons: [ 'csv', 'excel', 'pdf', 'print' ]
|
|
|
19 |
} );
|
|
|
20 |
} );
|
|
|
21 |
```
|
|
|
22 |
|
|
|
23 |
|
|
|
24 |
# Documentation / support
|
|
|
25 |
|
|
|
26 |
* [Documentation](https://datatables.net/extensions/buttons/)
|
|
|
27 |
* [DataTables support forums](http://datatables.net/forums)
|
|
|
28 |
|
|
|
29 |
|
|
|
30 |
# GitHub
|
|
|
31 |
|
|
|
32 |
If you fancy getting involved with the development of Buttons and help make it better, please refer to its [GitHub repo](https://github.com/DataTables/Buttons)
|
|
|
33 |
|