Wiki

Clone wiki

grails-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..

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.

Column Options

Column options can be added as attributes to the dt:column tag:

Checkbox Column Options

Checkbox Column options can be added as attributes to the dt:checkboxColumn tag:

See Also

Tags


Back to Home.

Updated