Wiki

Clone wiki

grails-datatables / reportButton

reportButton

Values

Name Type Values Default
reportButton boolean true, false false

Description

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 messsages.properties 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.

Example

<dt:datatable name="MyTable" domainClass="this.is.my.DomainClass" serverSide="true" reportButton="true">
    <dt:column name="myFirstProperty"/>
    <dt:column name="mySecondProperty"/>
</dt:datatable>

See Also

reportingEnabled, reportFunction


Back to Options.

Updated