Comments

raintonr’s picture

It would be nice to see a Datatables module, but I can confirm that the latest (dt 1.5) works with latest jQuery shipped with Drupal.

You can write yourself a little module (guess you'd be doing this anyhow to fetch the data) and put this in the page generation code:

  drupal_add_js(drupal_get_path('module', 'mymodule') . '/dataTables/media/js/jquery.dataTables.js');
  drupal_add_js(drupal_get_path('module', 'mymodule') . '/mymodule.js');

Where mymodule.js contains the ready function. Eg:

$(document).ready(function() {
  $('#dt_mymodule').dataTable();
} );

Sadly the theme_table function doesn't put <thead> tags in so I had to write my own, but aside from that looks to work just fine.

Unpack the dt zip file into your module directory and symlink dataTables to it (so you can easily switch between versions).

Skirr’s picture

Yes, i tried this way, but it seems that IMCE module have conflict with datatables. Didnt figure it out yet, but all "download buttons" in imce disappear.

duellj’s picture

If anyone is interested, I've created a new DataTables module: http://drupal.org/project/datatables

There isn't a stable release yet, but there's initial support for displaying views output as a datatable, as well as a basic datatable theme.

klonos’s picture

I am interested duellj...

thank you for bringing this to life. I will be testing and getting back with use cases, bug & feature reports soon as I start playing with it.

Rajan M’s picture

Hi All,
Here is an simple example of search form in Drupal using datatable, http://bit.ly/drupaldatatable.

Cheers,
Rajan