Clone wiki

grails-datatables / serverSide



Name Type Values Default
serverSide boolean true, false false


serverSide is a table option that will enable server-side processing. This does two things: it sets the serverSide option to true in the Javascript configuration to enable server-side processing as described in the above link; and it also configures the grails plugin to provide the data from the server. Each time a new page is viewed in the table, a request will be made to the DataTablesController to retrieve the data.

Both serverSide="true" and serverDataLoad="true" will cause the data to be downloaded from the server via an AJAX request. The DataTables plugin handles the processing to get the data from your domain objects and return it in a format that the DataTables JavaScript can consume.

The difference between serverSide="true" and serverDataLoad="true" is that serverSide="true" will obtain data one page at a time, while serverDataLoad="true" will download all the data at once. Thus, with serverSide=true, pagination and searching are performed by the server, while on the other hand with serverDataLoad="true", pagination and searching are all performed within the browser. See serverDataLoad for more information about that option.

If you find the built-in server-side processing to be unsuitable, you can additionally create your own controller to perform the server-side processing. You can specify this with the controller, dataAction and reportAction options. The format of the request and response is described here.


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

See Also

serverDataLoad, controller, dataAction, reportAction

Back to Options.