TableTools fails to change sSwfPath from default

TableTools fails to change sSwfPath from default

larsandtarslarsandtars Posts: 3Questions: 0Answers: 0
edited February 2013 in TableTools
Thanks for the great tool!

I am having trouble with the TableTools package.

I try to use

[code]
$('table.filter').dataTable( {
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "/MyProject/src-client/lib/TableTools-2.1.4/media/swf/copy_csv_xls_pdf.swf"
}
} );
[/code]

But the network call to load the swf file still goes to the default location (my server responds with a 200 OK response so no error pops up) and therefore the PDF and excel export buttons do not work. (I can manually change the default location and then it works fine - but it's a hack).

Also, if I have multiple tables on the same page, the sfw file loads very many times (there are many requests for it in my chrome browser network inspector) - Is there a way to have it just load once?

Thanks!

Replies

  • allanallan Posts: 63,502Questions: 1Answers: 10,471 Site admin
    Please link to a test case showing the issue: http://datatables.net/forums/discussion/12899

    > Also, if I have multiple tables on the same page, the sfw file loads very many times

    I've never understood why the browser's do that, and don't just cache the file. I don't know if that is something I have any control over, or rather, I don't know how to fix it if it is possible to fix. Any input from anyone else is welcome.

    Allan
  • thisismypasswordthisismypassword Posts: 1Questions: 0Answers: 0
    A test case for larsandtars' issue - http://live.datatables.net/irexak/3.
    The hack was the solution that I had used too.
  • larsandtarslarsandtars Posts: 3Questions: 0Answers: 0
    That is a great test case! Thanks for that.
    I did end up getting mine to work, but I forget exactly what I did.

    If I recall, I think I may have tried to store too much data in my cookies (when saving some other state for data tables). There is a 4KB limit for cookies which I went way over. I ended up using local storage instead. Surprisingly this actually solved a number of buggy behaviors. As a disclaimer, I don't remember 100% if this was my solution, but it may be worth a shot to investigate. Good luk.
This discussion has been closed.