examples.datatables.tabletools.js 682 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. (function( $ ) {
  2. 'use strict';
  3. var datatableInit = function() {
  4. var $table = $('#datatable-tabletools');
  5. $table.dataTable({
  6. sDom: "<'text-right mb-md'T>" + $.fn.dataTable.defaults.sDom,
  7. oTableTools: {
  8. sSwfPath: $table.data('swf-path'),
  9. aButtons: [
  10. {
  11. sExtends: 'pdf',
  12. sButtonText: 'PDF'
  13. },
  14. {
  15. sExtends: 'csv',
  16. sButtonText: 'CSV'
  17. },
  18. {
  19. sExtends: 'xls',
  20. sButtonText: 'Excel'
  21. },
  22. {
  23. sExtends: 'print',
  24. sButtonText: 'Print',
  25. sInfo: 'Please press CTR+P to print or ESC to quit'
  26. }
  27. ]
  28. }
  29. });
  30. };
  31. $(function() {
  32. datatableInit();
  33. });
  34. }).apply( this, [ jQuery ]);