Index

  1. Home
  2. Docs
  3. Index
  4. Data Publisher
  5. Export buttons

Export buttons

The premium version allows to add standard as well as custom buttons to a publication.

Supported standard button types and their abbreviations

C = Export to CSV
E = Export to Excel
F = Export to PDF
P = Print
Y = Copy to clipboard
S = Export to SQL
V = Toggle column visibility – list
T = Toggle column visibility – buttons

Example

{
	"dom": "Blfrtip", 
	"wpda_buttons": "CEF"
}
  • Adds export to CSV, Excel and PDF buttons to a publication
  • Options dom and wpda_buttons must be added to column table options advanced of the publication
  • Make sure column table options advanced contains valid JSON

Explanation

  • The B in { “dom”: “Blfrtip” } adds the buttons extension to the publication (case sensitive)
  • Characters CEF in { “wpda_buttons”: “CEF” } will add the standard buttons CSV, Excel and PDF (case insensitive)
  • Buttons are shown in the order they appear in option wpda_buttons

Adding row selection

The previous example of export buttons will export all visible rows. Use option “select” to allow users to select specific rows to be exported:

{
	"select": {
		"selector": "td:not(.dtr-control)",
		"style": "multi" 
	}
}

This option allows publication users to use the mouse to select rows. The row selection will be reflected in the export, print and copy actions.

Adding column selection

Column selection is available from a list button or a toggle button per column. Use option wpda_buttons to add column selection.

Add button to toggle columns from a list

{
	"dom": "Bfrtip", 
	"wpda_buttons": "V"
}

Add a button for each column

{
	"dom": "Bfrtip", 
	"wpda_buttons": "T"
}

Notes

  • This option requires that the button extension is loaded (needs: “dom”: “Bfrtip”)
  • Toggle column visibility does not work when search and list boxes are added to the table header
  • Toggle column visibility is not reflected in SQL exports
Was this article helpful to you? Yes 2 No

5 Replies to “Export buttons”

  1. Could you add a standard button to support Clear/Reset all filters. This should clear all column filters AND the main search input field.

    Thanks

    1. It is on my to do list Charles, but I it’s not in the upcoming release. I’ll do my best to add to the next. I’ll let you know…

      Sorry,
      Peter

  2. I would like to create three custom buttons having different functions and with different “titles” and “messages”. What is wrong with my syntax below? [I’m sure this is an easy fix but we all start somewhere.]
    ==========
    “wpda_buttons_custom”: [
    {
    “text”: “PDF”,
    “extend”: “pdf” ,
    “title”: “My Custom Button # 1”,
    “messageTop”: “Prepared by the Button Customizer”,
    “messageBottom”: “Prepared by the Button Customizer”,

    “text”: “PRINT”,
    “extend”: “print” ,
    “title”: “My Custom Button # 2”,
    “messageTop”: “Prepared by the Button Customizer”,
    “messageBottom”: “Prepared by the Button Customizer”,

    “text”: “COPY”,
    “extend”: “copy” ,
    “title”: “My Custom Button # 3”,
    “messageTop”: “Prepared by the Button Customizer”,
    “messageBottom”: “Prepared by the Button Customizer”,

    }
    ],
    “scrollX” : true
    }

    1. Hi Wayne,

      It looks like this isn’t valid JSON. You can turn on the JSON to valid while you edit in:
      Settings > WP Data Access > Data Publisher > JSON Editing

      Try this:
      {
      "wpda_buttons_custom": [
      {
      "text": "PDF",
      "extend": "pdf" ,
      "title": "My Custom Button # 1",
      "messageTop": "Prepared by the Button Customizer",
      "messageBottom": "Prepared by the Button Customizer"
      },
      {
      "text": "PRINT",
      "extend": "print" ,
      "title": "My Custom Button # 2",
      "messageTop": "Prepared by the Button Customizer",
      "messageBottom": "Prepared by the Button Customizer"
      },
      {
      "text": "COPY",
      "extend": "copy" ,
      "title": "My Custom Button # 3",
      "messageTop": "Prepared by the Button Customizer",
      "messageBottom": "Prepared by the Button Customizer"
      }
      ],
      "scrollX" : true
      }

      Hope this helps,
      Peter

Leave a Reply

Your email address will not be published. Required fields are marked *

3 × 1 =