TableTools fails to change sSwfPath from default
TableTools fails to change sSwfPath from default
larsandtars
Posts: 3Questions: 0Answers: 0
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!
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!
This discussion has been closed.
Replies
> 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
The hack was the solution that I had used too.
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.