Only one tabletools button works.

Only one tabletools button works.

rage10940rage10940 Posts: 48Questions: 0Answers: 0
edited March 2013 in DataTables 1.9
[code]
$(document).ready( function () {
$('.display').dataTable( {
"bJQueryUI": true,
"iDisplayLength": 50,
"sPaginationType": "full_numbers",
"sDom": '<"H"lfTr>t<"F"ip>',
"oTableTools": {
"aButtons": [
"print",
"csv",
"pdf"
]
}
});
});
[/code]

The only button that is working is the "print" button the csv or pdf dont.

my website is local host so I used the debugger

http://debug.datatables.net/azanax

Replies

  • rage10940rage10940 Posts: 48Questions: 0Answers: 0
    Bump for help.
  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin
    A search for "tabletools only print works" shows multiple threads on this topic:

    http://datatables.net/forums/discussion/13209
    http://datatables.net/forums/discussion/5225
    http://datatables.net/forums/discussion/11922

    Among many others.

    This example will help set the SWF path, which is likely to be the issue:
    http://datatables.net/release-datatables/extras/TableTools/swf_path.html

    Allan
  • rage10940rage10940 Posts: 48Questions: 0Answers: 0
    edited March 2013
    http://www.freeimagehosting.net/x6vc1

    http://www.freeimagehosting.net/zta1q

    Just to update, I did the sswfpath info. all my datatables config stuff is in one folder still to no luck. I will take a look at other threads for more information.
  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin
    Please link to a test case so we can offer some help rather than just guessing: http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read
  • rage10940rage10940 Posts: 48Questions: 0Answers: 0
    I can't like to a test case as this is a private college office intranet for tracking students. Only thing I can provide is code, screen shots and this :

    http://debug.datatables.net/otiyac

    Thank you for your patience.
  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin
    Sorry, I can't say why it is not working from that. The initialisation looks fine assuming all the files are in place.
  • rage10940rage10940 Posts: 48Questions: 0Answers: 0
    edited March 2013
    Yes my files are in place :

    http://www.freeimagehosting.net/zta1q

    I get a view of the buttons, they appear but nothing else happens. The .swf and table tools file are in the same directory.

    And my initialization code is posted above in a image :

    http://www.freeimagehosting.net/x6vc1
  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin
    That looks like it should work to me. I honestly can't say more than that without the ability to reproduce the error.
  • rage10940rage10940 Posts: 48Questions: 0Answers: 0
    Emailed you a test case.

    Thank you,

    Allan.
  • rage10940rage10940 Posts: 48Questions: 0Answers: 0
    edited April 2013
    Problem resolved... when setting the

    "sSwfPath": "/javascript/js/copy_csv_xls_pdf.swf",

    it had to be from the website root (or for me the base_url(); ----> I am using codeigniter)
    I thought it was either the full path, or the relative path from the actual file. It was the neither.

    It has to be the actual /path/from/url

    for me it is :

    https://xxxxxxxxxxxxxxxx/javascript/js/copy_csv_xls_pdf.swf

    hopefully some one can look at this and find an answer.
  • kalibrainkalibrain Posts: 3Questions: 1Answers: 0

    This absolutely worked for me. But Allan, could you please explain why this solved the problem? Btw, when I download legacy version of DataTable and try tabletools example, the only one was working 'print' option. (Even for untouched version of DataTable 1.9.2)

  • indymxindymx Posts: 63Questions: 3Answers: 0

    I noticed yesterday when I started to update one of my sites from the old Editor to the new one that no matter what I put in the sSwfPath that it tried to look at /swf/copy_csv_xls_pdf.swf for the file.

    I tried several different URLS in there and the code inspector showed it was only looking in my at that URL for the file.

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    Interesting - thanks for flagging that up. I'll debug this when I get back into the office on Tuesday.

    Allan

This discussion has been closed.