Tabletools Installation

Tabletools Installation

ltpittltpitt Posts: 4Questions: 0Answers: 0
edited August 2013 in General
Hi everybody!

I want to try the lovely Tabletools plugin but I don't know how to install it.

Where should I decompress and place the files?

The only thing to do next is:

$(document).ready( function () {
$('#example').dataTable( {
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "/swf/copy_csv_xls_pdf.swf"
}
} );
} );

Putting in path the correct path.

Is this everything?

I've tried it but probably I need to place and name the folders differently because it didn't work.

Thanks for your time!

Replies

  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin
    If you download the DataTables package from http://datatables.net/download - TableTools is in the "extras" folder and all the paths are correct for there. If you want to put the files else where, then you'll need to modify the paths as needed.

    Allan
  • ltpittltpitt Posts: 4Questions: 0Answers: 0
    Hi there!

    I have just downloaded DataTables-1.9.4.zip, I've put it in my site's root folder...

    I've unzipped it so the final look is:

    /var/www/mysite/tabletools

    I've searched without luck for the extras folder.

    Should I create the extra folder and download tabletools separately and extract it in the extra folder?
  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin
    Look in DataTables-1.9.4/extras/TableTools .

    Allan
  • jhcomputejhcompute Posts: 26Questions: 0Answers: 0
    Hello,

    Take a look at this.
    http://datatables.net/usage/

    and this.
    http://datatables.net/release-datatables/examples/basic_init/zero_config.html

    This should get you going.

    Cheers...
  • ltpittltpitt Posts: 4Questions: 0Answers: 0
    @allan

    Sorry: while braindead I downloaded the wrong file :)

    Now everything is in place and finally the "Print, Pdf" and so on appeared on the page.

    I've put in the head section of my html:


    /script>

    and corrected accordingly the init:

    "sDom": 'T<"clear">lfrtip',
    "oTableTools": {
    "sSwfPath": "datatables/extras/TableTools/media/swf/copy_csv_xls_pdf.swf"
    },

    But the nasty thing still won't work.

    The "Print, copy, export to excel" and so on buttons look like plain text so I must be still missing something...

    I'll fiddle some more and then write back with a complete howto for future (and braindead) users :)


    @jhcompute

    Hi and thanks for help!

    My basic configuration should be ok because my datatables are showing up nice and work perfectly.
    All I wanted to add is the pdf and excel export.

    Anyway I'm checking your links now: thanks :)
  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin
    If you could link to the page that will enable us to say what is going wrong.

    Allan
  • ltpittltpitt Posts: 4Questions: 0Answers: 0
    Finally! :D

    I love it! :D

    So here's the complete procedure to install tabletools for datatables, merging your kind suggestions and my trial and error:

    a) Download from here (http://datatables.net/download/) the complete package and decompress the folder and rename it as you prefer (I called mine datatables and copied it in my site root therefore all the paths you'll find here are simply mine: change yours accordingly to where you places your decompressed folder)

    b ) Prepare your html and javascript following the basic examples here:

    http://datatables.net/usage/

    and here:

    http://datatables.net/release-datatables/examples/basic_init/zero_config.html

    c) Once you have your datatables up and running add to your html file head section:









    and finally:

    d) Initialize your datatables with tabletools:

    $(document).ready( function () {
    $('#example').dataTable( {
    "sDom": 'T<"clear">lfrtip',
    "oTableTools": {
    "sSwfPath": "/swf/copy_csv_xls_pdf.swf"
    }
    } );
    } );


    Have fun and enjoy this lovely plugin.

    Thanks again to Allan and Jhcompute for their time and patience.
This discussion has been closed.