plug-in.xml 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <dt-example table-type="html" order="1">
  3. <css lib="datatables tabletools" />
  4. <js lib="jquery datatables tabletools">
  5. <![CDATA[
  6. $.fn.dataTable.TableTools.buttons.copy_to_div = $.extend(
  7. true,
  8. $.fn.dataTable.TableTools.buttonBase,
  9. {
  10. "sNewLine": "<br>",
  11. "sButtonText": "Copy to element",
  12. "sDiv": "",
  13. "fnClick": function( nButton, oConfig ) {
  14. document.getElementById(oConfig.sDiv).innerHTML =
  15. this.fnGetTableData(oConfig);
  16. }
  17. }
  18. );
  19. $(document).ready(function() {
  20. $('#example').DataTable( {
  21. dom: 'T<"clear">lfrtip',
  22. tableTools: {
  23. "aButtons": [ {
  24. "sExtends": "copy_to_div",
  25. "sButtonText": "Copy to div",
  26. "sDiv": "copy"
  27. } ]
  28. }
  29. } );
  30. } );
  31. ]]>
  32. </js>
  33. <title lib="TableTools">Plug-in button types</title>
  34. <info><![CDATA[
  35. This example shows how you can add a message to the saved PDF using the `sPdfMessage` parameter. It also shows that the orientation of the output PDF can be changed to landscape which is useful if you have a lot of columns.
  36. ]]></info>
  37. <demo-html>
  38. <div id="copy" class="box" style="height: 100px; overflow: auto">
  39. Copy output will go here
  40. </div>
  41. </demo-html>
  42. </dt-example>