Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Views Bootstrap 5.5.4 — Minor update available for module views_bootstrap (5.5.4). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Release: CommentOn 1.0.6 — Minor update available for module commenton (1.0.6). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: Opensolr Search 5.1.3 — Minor update available for module opensolr_search (5.1.3). Release: ServiceM8 Webform Integration 1.2.1 — Minor update available for module servicem8_webform (1.2.1). Release: PostfixAdmin 1.0.0 — Initial release available for module postfix_admin (1.0.0)! Release: ip_analyser 1.0.3 — Minor update available for module ip_analyser (1.0.3). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

Datatables server side

An implementation of DataTables server side - https://datatables.net/manual/server-side
processing using Drupal views as the backend for configuring the data source,
filters and sortable fields.

This module provides:

  • A block the integrates the http://datatables.net plugin into a Drupal Block
  • A Views style plugin that works with the block to provide service side processing for datatables.
  • An implementation of hook_views_pre_view() that does the heavy lifting of converting the DataTables requests into views settings.

Using this module is a two step process:

1. Create the view with the data:

  1. Create a view as normal.
  2. Add a new REST export display.
  3. In the *Format* section, select *DataTables server side*.
  4. In settings, ensure *json* is selected.
  5. Set the pager to *full*, 10 items.

2. Place an instance of the block:

  1. Visit The Block layout page - admin/structure/block.
  2. Click *Place block* in the region you want the block to appear.
  3. Click *Place block* for the DataTables server side block.
  4. In the *Configure block* modal, select the view created earlier.
  5. Once thats selected, the display selection drop down will appear.
  6. Select the REST export using the DataTables server side style.
  7. Its a standard block, so any other settings should work as normal.

Multiple block instances:

  • This should work fine as long as the machine name for each block is different.

Enable searching:

  1. On the view, add Filter criteria for each field that should be included when the search box is used.
  2. Typically using *Contains* will get the best results.
  3. Leave the value empty, it will be filled from the DataTable request.
  4. Do not set the filter to *exposed*.
  5. The text will automatically be searched for across all the fields with a filter.
  6. **Only basic text filters are supported**

Enable sorting:

  1. On the view, add Sort criteria for each field that sorting should be enabled for.
  2. The Block will detect that there are sort fields and enable if for each related column.

Project links.

  • For a full description of the module, visit the project page:
  • To submit bug reports and feature suggestions, or to track changes:
  • For more information about the DataTables plugin, full documentation and examples are available at:

Troubleshooting:

  • If no total count, or paging not working, ensure the pager is set to full on the view, or the total records isn't counted.
  • Check console log for any JavaScript errors.
  • Check access log to ensure that submitted requests are coming through.
  • Check Watchdog log for errors.

Credits:

This module is inspired by:

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Sep 2024
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core Release date
1.0.x-dev Dev 9–10 Sep 11, 2024