Clone wiki

grails-datatables / reportButton



Name Type Values Default
reportButton boolean true, false false


reportButton is a table option that will place a Download Report button in the table footer.

Note that you can opt to use your own report button if you prefer. The GrailsDataTables plugin provides a JavaScript function for each table (when reporting is enabled) called get[Name]ReportUrl(), where [Name] is the name of your table. Thus, you can call that function to get the URL from which to download the report. The URL contains the table's current sorting and filtering settings.

The title and text of the button can be set using i18n. Add the following entries into your file:

datatables.language.downloadReport.title = My Download Report button title.
datatables.language.downloadReport.text = My Download Report button text.

Reporting is only available when either serverSide or serverDataLoad is set to true.


<dt:datatable name="MyTable" domainClass="" serverSide="true" reportButton="true">
    <dt:column name="myFirstProperty"/>
    <dt:column name="mySecondProperty"/>

See Also

reportingEnabled, reportFunction

Back to Options.