collection.xml 1.0KB

123456789101112131415161718192021222324252627282930313233343536
  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. "copy",
  12. "print",
  13. {
  14. "sExtends": "collection",
  15. "sButtonText": "Save",
  16. "aButtons": [ "csv", "xls", "pdf" ]
  17. }
  18. ]
  19. }
  20. } );
  21. } );
  22. ]]>
  23. </js>
  24. <title lib="TableTools">Button collections</title>
  25. <info><![CDATA[
  26. TableTools provides the ability to group buttons into a hidden drop down list, which is activated by clicking on a top-level button. This is achieved by extending the 'collection' predefined button type and setting it's `aButtons` parameter with the same options as the top level buttons (note that you cannot currently use a collection within a collection).
  27. The example below shows the file save buttons grouped into a collection, while the copy and print buttons are left on the top level.
  28. ]]></info>
  29. </dt-example>