TableTools copy, csv, pdf not working in 1.9.1/2.0.3 for server side tables

TableTools copy, csv, pdf not working in 1.9.1/2.0.3 for server side tables

longwalongwa Posts: 2Questions: 0Answers: 0
edited April 2012 in TableTools
Copy, CSV, and PDF were working fine with 1.9.0 and TT 2.0.2.

I decided to upgrade each to the latest version and now those functions are only working for tables that are client side. Both tables define the .swf file (which I see changed to have CSV spelled properly). For the server side tables, the tools act almost like the SWF file can't be loaded, but I verified the path and that the file is available at that path by pointing the browser at it directly.

The only difference between the tables that work and the ones that don't is the following block:

[code]
"bDeferRender": false,
"bServerSide": true,
"sAjaxSource": "",
"fnServerParams": function( aoData ) {
var formData = $theTable.prop("formData");
$.each(formData, function(i, obj) {
aoData.push(obj);
});
},
"sServerMethod": "POST",
"iDeferLoading": 0,
[/code]

Like I said, the only thing that changed was the upgrade.

Thoughts?

Replies

  • longwalongwa Posts: 2Questions: 0Answers: 0
    Actually, I think I found the difference.

    For AJAX sourced tables, we don't want to show the empty search results until the user actually tries to run a search for the first time (so the initial screen just has search criteria and then the tables appears and populates once they search).

    Since the page isn't reloading, we hide the div that contains the table upon page load and then show the table in the callback once the AJAX call is complete. It seems like in DT1.9.1 and TT2.0.3, the flash buttons don't get glued onto the page correctly if the table is initially hidden. Like I said, this same strategy worked in the older version.

    Maybe there's a better way to accomplish what we want to do, I'm open to suggestions. By unhiding the initial table, the flash buttons are working again.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Its interesting that this worked in TableTools 2.0.2 - I'm surprised by that! However, the way to address this currently is to use the TableTools fnResizeButtons ( http://datatables.net/extras/tabletools/api#fnResizeButtons ) API method just after you make the buttons visible. The reason for this is that when he table is hidden the browser doesn't calculate its dimensions, thus the buttons end up as 0, 0 height / width. This is why I'm surprised that it worked before! I will investigate further!

    Allan
  • conradfrconradfr Posts: 4Questions: 0Answers: 0
    edited May 2012
    I upgraded from TT 2.0.2 to 2.0.3 and it is not working anymore. Flash is launched (as proved by right clicking on it) but the buttons are like disabled (no rollover effect, can't be clicked).

    Print button works fine though (not flash based I guess).

    It's not a big deal right now as 2.0.2 is still working and there is no changelog for TT so I don't know what I'm missing ;)
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Change log is on the downloads page: http://datatables.net/download/ - click the "Notes" link for the TableTools release.

    Regarding the issue - are you seeing any errors on the browser's console? If not, then we'll need a link to be able to offer any help.

    Allan
  • conradfrconradfr Posts: 4Questions: 0Answers: 0
    edited May 2012
    Ok so I come to work today, refresh the application and ... it works ! Maybe some cache conflict yesterday while updating both dataTables and TT.

    I'm ashamed for both the changelog and the false issue.

    Keep moving, nothing to see here :)
This discussion has been closed.