Table Tool Buttons Not Working (inside DIVs) w/ JQuery Tabs

Table Tool Buttons Not Working (inside DIVs) w/ JQuery Tabs

bgearrinbgearrin Posts: 3Questions: 0Answers: 0
edited May 2012 in TableTools
Hi,

I am having a problem making the buttons work as intended with table tools. When implemented, the CSV and PDF buttons do not do anything when they are clicked and I think its related to a DIV problem. I have verified Data Tables and Table Tools work by removing all DIVs and only using one DIV on the page (I am running the latest version of Data Tables and Table Tools).

Any ideas on why this wouldn't work with 2 DIVs and the table inside?


[code]





[/code]

[code]

$(document).ready(function () {
$('#test').dataTable({
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "/media/swf/copy_csv_xls_pdf.swf",
"aButtons": ["csv", "pdf", "print"]
}
});

[/code]

[code]





ID
Name




1
2


3
4





[/code]

Any help would be greatly appreciated!

Replies

  • bgearrinbgearrin Posts: 3Questions: 0Answers: 0
    Fixed

    My issue was directly related to JQuery Tabs with Table Tools Buttons not working. Info can be found here:

    http://datatables.net/forums/discussion/3783/x&page=1#Item_4
    https://github.com/DataTables/TableTools/blob/master/tabs.html
  • AA23AA23 Posts: 13Questions: 0Answers: 0
    Does anybody got the Button issue resolved in TableTools ????
    I also implemented the same thing but there is no action when i click on the buttons.
    What should I do . Please suggest me something I stuck.
  • AA23AA23 Posts: 13Questions: 0Answers: 0
    Please somebody reply .......
    My code is
    $('#table1').dataTable( {
    "bJQueryUI": true,
    /* "sPaginationType": "full_numbers", */
    "bProcessing": true,
    "bServerSide": true,
    "bDestroy": true,
    "bAutoWidth": true,
    "sScrollX": "940px",
    //"sScrollY": "250px",
    "bScrollCollapse": true,
    "aoColumns": [
    null,
    null,
    null,
    null,
    null,
    null,
    { "bSortable": false }
    ] ,
    "sDom": 'T<"clear"><"H"lfr>t<"F"ip>',
    "oTableTools": {
    //"sSwfPath": "/public/swf/ZeroClipboard.swf",
    "sSwfPath": "//swf/copy_csv_xls_pdf.swf",
    "aButtons": [
    "copy",
    "csv",
    "xls",
    {
    //"sExtends": "collection",
    "sExtends": "pdf",
    "sTitle": "Report Name",
    "sPdfMessage": "Summary Info",
    "sPdfOrientation": "landscape",
    //"sSwfPath": "/swf/ZeroClipboard.swf",
    "fnClick": function( nButton, oConfig ) {
    this.fnPrint( true, oConfig );
    },
    "print"
    ]

    },
    "sAjaxSource": url,
    "fnServerData": function ( sSource, aoData, fnCallback ) {
    // Add some extra data to the sender
    //aoData.push();
    $.ajax( {
    "dataType": 'json',
    "type": "POST",
    "url": sSource,
    "data": aoData,
    "success": fnCallback
    } );

    }

    });
  • AA23AA23 Posts: 13Questions: 0Answers: 0
    Please review he code and tell me the problem.....
  • AA23AA23 Posts: 13Questions: 0Answers: 0
    Please if anybody can help please suggest your review on the above code ...

    The buttons of TableTools are getting displayed but nothing is happening on clicking on them,
  • pradkspradks Posts: 1Questions: 0Answers: 0
    I came across the excat issue, first check if the flash pugin is installed.
    secondly, the swf path should not be absolute,
    //swf/copy_csv_xls_pdf.swf",

    Use the below path and make sure ur swf is in the appropriate folder
    swf/copy_csv_xls_pdf.swf",
  • AA23AA23 Posts: 13Questions: 0Answers: 0
    flash 11 is installed on my pc and it is not a issue according to me ........The path when i changed with swf/copy_csv_xls_pdf.swf the firebug shows cannot find path but the relative path is error free but still the buttons are not working.....
  • davidliang2008davidliang2008 Posts: 2Questions: 0Answers: 0
    I am using Twitter Bootstrap tabs though. The solution is to check if the resize is required when the tabs are shown.
    [code]
    $('.nav-tabs a[data-toggle="tab"]').on('shown', function(e) {
    var ttInstances = TableTools.fnGetMasters();
    for (var i in ttInstances) {
    if (ttInstances[i].fnResizeRequired())
    ttInstances[i].fnResizeButtons();
    }
    });
    [/code]
    You get the idea.
  • chandanbokarochandanbokaro Posts: 4Questions: 0Answers: 0
    Tried all combinations and solutions provided. Using datatables @version 1.9.4
    tabletools * Version: 2.1.5.dev and jquery v1.8.3 but still can get tabletools to work on all tabs.
    (Tabs loaded via ajax and different jsp pages ). Flash is working properly.

    On the first tab everything works perfectly. 2nd tab onwards, flash works. when i click copy, it says zero rows copied. I dont know. Though the tabletools are loaded, it somehow is not able to capture data or something.

    when the tabs directly load the data , the tabletools doesnt work. but when i populate the table after an event , say based on a select statement populate the table, the tabletools start working.

    Just stuck on this one.
This discussion has been closed.