Only one tabletools button works.
Only one tabletools button works.
rage10940
Posts: 48Questions: 0Answers: 0
[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
$(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
This discussion has been closed.
Replies
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
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.
http://debug.datatables.net/otiyac
Thank you for your patience.
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
Thank you,
Allan.
"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.
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)
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.
Interesting - thanks for flagging that up. I'll debug this when I get back into the office on Tuesday.
Allan