Add Datatables plugin
Skirr - September 20, 2009 - 22:13
| Project: | jQuery plugins |
| Version: | 6.x-1.9 |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Is it possible to add DataTables plugin ?
http://www.datatables.net
http://plugins.jquery.com/project/DataTables

#1
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:
<?phpdrupal_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.jscontains the ready function. Eg:$(document).ready(function() {$('#dt_mymodule').dataTable();
} );
Sadly the
theme_tablefunction 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
dataTablesto it (so you can easily switch between versions).#2
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.