Created
January 6, 2012 01:36
-
-
Save kagemusha/1568446 to your computer and use it in GitHub Desktop.
JQuery Datatables: Show/Hide controls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tested on: Databables 1.8.2 | |
Datatables comes with controls for filtering and pagination. These can be shown and hidden in a couple of ways (all examples in coffeescript): | |
Way 1 | |
$("#myTable").dataTable | |
"bPaginate": false, #hide pagination control | |
"bFilter": false #hide filter control | |
Way 2: Use the "sDom" prop | |
$("#myTable").dataTable | |
"aaData": data | |
"sDom": 'ft' | |
Here 'f' means filter and 't' means table, so only show those. Order matters: 'ft' puts | |
the filter on top, whereas 'tf' will put it on bottom. | |
For more complex and other widgets, see Ref | |
Ref: http://datatables.net/usage/options#sDom |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment