Table Tools problem with Post Load data?

Table Tools problem with Post Load data?

mstewmstew Posts: 7Questions: 0Answers: 0
edited November 2012 in TableTools
I have run the debugger on my specific instance (epoqaj) of dataTable where I build my data from an ajax request and then format that data for dataTable using the following code:
[code] function forDataTable(jsonArray){
var cols = getCols(jsonArray);
var tableCols = new Array();
for(c in cols){
tableCols.push({"sTitle":cols[c]});
}
var dataArray = new Array();
dataToArray(dataArray, jsonArray, cols);
return {
"aaData": dataArray,
"aoColumns": tableCols,
"bDestroy": true,
"sDom": 'T<"clear"><"H"lfr>t<"F"ip>',
"oTableTools": {
"sSwfPath": "/mold_demo2/scripts/TableTools/swf/copy_csv_xls_pdf.swf"
}
}
} [/code]

The object returned from this function is then passed directly into dataTable. I am just beginning to implement the Table Tools because of a request for export and have never had this feature working. The links appear (although not as buttons) and the print button does something but does not include the print dialog (at least not in chrome). I have checked all of the calls and note that none have 404s.

Can anyone help me get my exports working?

Please and thank you,
Michelle

Replies

  • mstewmstew Posts: 7Questions: 0Answers: 0
    I don't think I've gotten any closer to a solution here, in fact I may have gotten further away (unfortunately). Since I was stuck on this aspect of my dataTable I moved on to providing detail rows. I could not for the life of me get the column for the expand/shrink link to display (even after switching to just passing a json array of objects). The more examples I read and the more problems I run into, the more I see it pointing me to use the ajax loading (which I recently discovered I could do with parameters) but I have issues with my header rows changing (due to different columns returned) and many other issues that my co-workers and I have taken the approach of building our tables before adding the dataTable to it. Here is a link to the demo site I am developing: http://nysus.net/mold_demo2/rep_production2.php Is there something I'm missing? Am I doing this all wrong? I want to keep my code as clean and re-useable as possible any help will be GREATLY appreciated.

    PS: The tableTools are still not displaying, but the newest debug link for my data is: ihaneb
  • mstewmstew Posts: 7Questions: 0Answers: 0
    I redownloaded DataTables and it is working now, so my only remaining problem is how to deinitialize and reinitialize on my html table when the info has changed.
    I know it should be [code]
    var oTable = $('#example').dataTable();

    // Immediately 'nuke' the current rows (perhaps waiting for an Ajax callback...)
    oTable.fnClearTable();
    [/code]
    But everytime I do that (with any function) I get errors on the oTable.fn.... line

    What am I doing wrong?
  • allanallan Posts: 63,497Questions: 1Answers: 10,470 Site admin
    You get an error with those two lines above? I just loaded your link above and don't get that error when the page is loaded? What needs to be done to reproduce it?

    Allan
  • mstewmstew Posts: 7Questions: 0Answers: 0
    I don't currently have the function call on the page so that I could continue development. I can put it in so we can see, because I need to be able to change the page size and that will require a call like this too.
  • mstewmstew Posts: 7Questions: 0Answers: 0
    When I added the function call back in it isn't erroring anymore (I wonder if I was trying to call it incorrectly) but the changes don't seem to be applying :(
  • mstewmstew Posts: 7Questions: 0Answers: 0
    Everything is working correctly right now! I don't know what changes I made that fixed it, but I appreciate your trying to help I'm sorry if I wasted any of your time!

    Thank you
This discussion has been closed.