Wiki
Clone wikigrails-datatables / Options
DataTables jQuery Plugin Options
There are many options for the DataTables jQuery Plugin that are documented here.
Generally, you can add any of the table options (that is, options without the columns
prefix) as attributes to the dt:datatable
tag, and any of the column options (that is, options with the columns
prefix) as attributes to the dt:column
tag.
(The plugin will add all of the column options to the columns
array in the configuration object).
To add options that are nested, such as ajax.data, simply use the format ajax.data="myFunction(d);"
in the dt:datatable
tag.
GrailsDataTables Plugin Options
The GrailsDataTables plugin provides some additional options beyond those provided by the jQuery DataTables plugin. These are listed below (although some of the options provided by the DataTables jQuery Plugin are also listed here in order to provide special documentation). Refer to the example for each option to see how it can be used.
Configuration Options
Configuration options are global options that are set in your configuration file. They will apply to all DataTables in your application that are produced via this plugin. Each of the settings below can optionally be added to your configuration file. Note that they all share the common prefix of grails.plugin.datatables.
.
- grails.plugin.datatables.dateFormat
- grails.plugin.datatables.dateTimeFormat
- grails.plugin.datatables.timeFormat
- grails.plugin.datatables.dbDateFormat
- grails.plugin.datatables.dbDateTimeFormat
- grails.plugin.datatables.dbTimeFormat
- grails.plugin.datatables.dateFormatLength
- grails.plugin.datatables.dateTimeFormatLength
- grails.plugin.datatables.timeFormatLength
- grails.plugin.datatables.functionsTemplate
- grails.plugin.datatables.functionsTemplatePlugin
- grails.plugin.datatables.jQueryUI
- grails.plugin.datatables.reportService
- grails.plugin.datatables.reportSizeLimit
- grails.plugin.datatables.tableDefaults
Table Options
Table options are options that are normally specified as attributes in the dt:datatable
tag element. They are used to configure various aspects of the table, including how the data should be obtained and which features should be enabled.
Note that table options may also be specified globally using the tableDefaults configuration option.
Here is the list of table options that have special meaning for the GrailsDataTable plugin. As noted above, the JQuery Datatables plugin also provides many options that you can also use.
- adjustColumnWidths
- ajaxParams
- columnSearching
- controller
- dataAction
- dataItems
- deferInitialization
- domainClass
- errorFunction
- headingParams
- hideWhenEmpty
- name
- reportAction
- reportButton
- reportFunction
- reportingEnabled
- resetButton
- searchButton
- searching
- serverDataLoad
- serverSide
- showMetadata
- sqlRestrictionFunction
- tableSearching
Column Options
Column options can be added as attributes to the dt:column
tag:
- criteria
- dataFunction
- dataType
- falseText
- heading
- headingKey
- include
- joinTypes
- linkAction
- linkController
- linkIdField
- name
- orderable
- order
- searchable
- trueText
- visible
Checkbox Column Options
Checkbox Column options can be added as attributes to the dt:checkboxColumn
tag:
See Also
Back to Home.
Updated