Unable to use TableTools Copy function (Possible bug?)

Unable to use TableTools Copy function (Possible bug?)

newtodatatablesnewtodatatables Posts: 31Questions: 0Answers: 0
edited June 2011 in TableTools
Hi there, I have successfully got my TableTools working from my previous thread here: http://datatables.net/forums/discussion/5225/tabletools-fails-to-initialize-copy-pdf-xls-functions-not-working Everything is working fine after I made the right reference to the swf file.

However, when I created another table with different table id in another page, the copy function stopped working. Wonder what is wrong?

Script
[code]
oTable = $('#test').dataTable({

"bFilter": false,
"bSort": false,
"bProcessing": true,
"bDestroy" : true,
"bAutoWidth" : false,
"aoColumns" : [

{ sWidth : "28%" },
{ sWidth : "28%" },
{ sWidth : "14%" },
{ sWidth : "15%" },
{ sWidth : "15%" }

],
"oLanguage": {
"sZeroRecords": "No data found!"
},
"sDom": 'TRC<"clear">lrtip',
"oTableTools": {
"sSwfPath": "plugins/dataTables/TableTools/media/swf/copy_cvs_xls_pdf.swf",
"aButtons": [ "copy",
"print",
{
"sExtends": "collection",
"sButtonText": "Export",
"aButtons": [{
"sExtends": "csv",
"sFileName": "Data.csv",
"mColumns": "visible"

},
{
"sExtends": "xls",
"sFileName": "Data.xls",
"mColumns": "visible"

},
{
"sExtends": "pdf",
"sFileName": "Data.pdf",
"mColumns": "visible"
} ]
}
]
}
[/code]

HTML

[code]





Col 1
Col 2




<%

List appList = AppManager.getAppList();
Iterator iter = appList.iterator();
while (iter.hasNext()) {
Application app = iter.next();
%>



<%=app.getName()%>
<%=app.getId()%>

<%
}
%>


[/code]

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Looks okay to me - if you look at your server error log, do you see any 404 errors? Failing than, can you give us a link?

    Allan
  • newtodatatablesnewtodatatables Posts: 31Questions: 0Answers: 0
    Nope no errors. As of now, I cant post any links yet. Forgot to mention, the icon does not "light up" when mouseover unlike my other table. This means the adobe flash was not loaded? Also, when I clicked on the"copy" function, I am redirected to my index page.

    By the way, all the other buttons, print, pdf, excel etc are all working fine.

    Thanks for your help!
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    [quote]newtodatatables said: This means the adobe flash was not loaded?[/quote]

    Correct - most likely the SWF file hasn't been loaded. Have a look at the page in Chrome and look at the 'console' of the Developer Tools. It will tell you if you get getting any 404 errors.

    I've never heard of the copy not working when the Excel and PDF buttons are working though! I thik I would probably need to be able to reproduce that to have any chance of fixing it.

    Allan
  • newtodatatablesnewtodatatables Posts: 31Questions: 0Answers: 0
    Thanks for your reply. I will try to debug and post working solution if I succeed!
  • newtodatatablesnewtodatatables Posts: 31Questions: 0Answers: 0
    Hi, I have tried to debug but was unsuccessful. I have a few tables in different tables on the same page. All of the tables have different naming. However, only the table in the first tab that was the first to be initialised has the TableTools Print function working. For all the other tables, the TableTools functions are all working fine Except "Print".
This discussion has been closed.