TableTools in theme_datatable function

Created on 6 March 2015, over 9 years ago
Updated 17 January 2024, 5 months ago

I'm trying to add TableTools by theme_datatable, it seems not working

$table = theme('datatable',array(
        'header' => $colnames,
        'rows' => $rows,
        'sticky' => true ,
        'attributes' => array(
          'id' => 'my_table_id',
          'datatable_options' => array( 
            'aLengthMenu' => array(array(25, 50, 75, -1), array(25, 50, 75, "All")),
            'iDisplayLength' => 25,
            'dom' => 'T<"clear">lfrtip',
            'tableTools' => array(
              'aButtons' => array('copy','xls','print'),
              'sSwfPath' => base_path() . _datatables_get_path() . '/extras/TableTools/media/swf/copy_csv_xls_pdf.swf'
            ),           
          )
        ), 
        'empty'=>t('No apps found matching selected criteria'),
        )); 
  
  drupal_add_library('datatables', 'datatables-tabletools');

the views plugin, instead, work fine

💬 Support request
Status

Closed: cannot reproduce

Version

1.2

Component

Code

Created by

🇮🇹Italy saveriop

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024