O'Reilly logo

Drupal 6 Theming Cookbook by Karthik Kumar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding column-sort functionality to tables

Drupal tables, while they can be made sortable when declared, require a page load every time a column needs to be sorted. This recipe details the steps required to achieve JavaScript-based sorting for HTML table columns. We will be accomplishing this through the use of the dataTables plugin for jQuery.

Getting ready

While we can just as easily implement this recipe using the theme layer, we will be using the mysite module, created earlier in this book, to do so since we are making use of a plugin. It is assumed that this module has been created and is enabled.

The dataTables plugin can be downloaded from http://www.datatables.net. The version of dataTables available might not be compatible with the version ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required