Skip to content

Instantly share code, notes, and snippets.

@kagemusha
Created January 6, 2012 01:36
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save kagemusha/1568446 to your computer and use it in GitHub Desktop.
Save kagemusha/1568446 to your computer and use it in GitHub Desktop.
JQuery Datatables: Show/Hide controls
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