TableTools swf don't work
TableTools swf don't work
acamus
Posts: 3Questions: 0Answers: 0
Hi,
First, i'm sorry for my english... i'm french... :)
Nothing happens when i click on cpy-xls-csv-pdf buttons.
I have already check my sSwfPath. I haven't got 404 error.
Here, my code in the "ready" function :
[code]
$('#demo').append('' );
$('#exemple').dataTable( {
"sDom": 'T<"clear">lfrtip',
"aaData": val.infos,
"aoColumns": (val.type=='WRF' ? clnWRF : clnCP),
"oTableTools": {
"sSwfPath": "./js/TableTools/media/swf/copy_csv_xls_pdf.swf",
"aButtons": [
"copy",
{
"sExtends": "csv",
"sTitle": val.legend.replace(/ /g, '_')
},{
"sExtends": "xls",
"sTitle": val.legend.replace(/ /g, '_')
},{
"sExtends": "pdf",
"sTitle": val.legend.replace(/ /g, '_')
},
"print"
]
}
});
[/code]
And in the i have :
[code]
[/code]
The variable 'val' is a JSON and the datatables works. The "print" button works too.
What is wrong in my code ? Can you help me ?
First, i'm sorry for my english... i'm french... :)
Nothing happens when i click on cpy-xls-csv-pdf buttons.
I have already check my sSwfPath. I haven't got 404 error.
Here, my code in the "ready" function :
[code]
$('#demo').append('' );
$('#exemple').dataTable( {
"sDom": 'T<"clear">lfrtip',
"aaData": val.infos,
"aoColumns": (val.type=='WRF' ? clnWRF : clnCP),
"oTableTools": {
"sSwfPath": "./js/TableTools/media/swf/copy_csv_xls_pdf.swf",
"aButtons": [
"copy",
{
"sExtends": "csv",
"sTitle": val.legend.replace(/ /g, '_')
},{
"sExtends": "xls",
"sTitle": val.legend.replace(/ /g, '_')
},{
"sExtends": "pdf",
"sTitle": val.legend.replace(/ /g, '_')
},
"print"
]
}
});
[/code]
And in the i have :
[code]
[/code]
The variable 'val' is a JSON and the datatables works. The "print" button works too.
What is wrong in my code ? Can you help me ?
This discussion has been closed.
Replies
The SWF path didn't work for me as a relative path, I had to specify the complete URL.
The SWF buttons didn't work if the table was initially hidden, either within a jQuery UI tab or accordion, and to fix I had to call the fnDraw function. I have since modified so that I have only a single datatable and it is in a Tab that is initially visible.
it's probably because a use tabs... But the fnDraw don't fix it !
Where do you used it ?
http://www.datatables.net/forums/discussion/5859/tabletool-problem-when-hiding-datatable_wrapper/p1