button_text.xml 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. $(document).ready(function() {
  7. $('#example').DataTable( {
  8. "dom": 'T<"clear">lfrtip',
  9. "tableTools": {
  10. "aButtons": [
  11. {
  12. "sExtends": "copy",
  13. "sButtonText": "Copy to clipboard"
  14. },
  15. {
  16. "sExtends": "csv",
  17. "sButtonText": "Save to CSV"
  18. },
  19. {
  20. "sExtends": "xls",
  21. "oSelectorOpts": {
  22. page: 'current'
  23. }
  24. }
  25. ]
  26. }
  27. } );
  28. } );
  29. ]]>
  30. </js>
  31. <title lib="TableTools">Custom button text</title>
  32. <info><![CDATA[
  33. You may wish to set your own text for the buttons in the TableTools toolbar, rather than relying on the default built-in text. This is done by overriding the `sButtonText` parameter of whatever button you wish to alter. The way TableTools allows you to alter a predefined button is by 'extending' it (using the `sExtends` parameter) and then setting the overriding parameter.
  34. A full list of the parameters which can be used is [available on the DataTables.net web-site](http://datatables.net/extensions/tabletools/button_options). This example shows how to set the button text as required.
  35. ]]></info>
  36. </dt-example>