1. Home
  2. Docs
  3. Index
  4. Data Publisher
  5. Adding Buttons [Premium]

Adding Buttons [Premium]

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(.wpda_select)",
		"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 No

Leave a Reply

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