csv button click event not getting fired

csv button click event not getting fired

shrinidhi_hashrinidhi_ha Posts: 6Questions: 0Answers: 0
edited October 2013 in TableTools
Hi

I am new to this dataTable and i have reached to a stage where i am able to apply the dataTable to table successfully but when i use the Tabletools plugin integrated with csv option, i am able to see the csv button in the browser but onclick the csv button is not firing the click event. I am not sure whether i am following the right way of calling the csv button event.

please let me know where i am going wrong.

i am also placing the complete html code which i am using
jquery version which i am using is 1.10.3 stable version with jquery 1.9.1.
TableTools 2.1.5
dataTables 1.9.4

[code]













[/code]


the below code is being used for dataTable initialization with TableTools plugin initialization with csv button.
[code]
$(document).ready(function() {
//<!--TableTools.DEFAULTS.aButtons = [ "copy", "csv", "xls" ];-->
$('#results').dataTable( {
"bFilter":false,
"bJQueryUI": false,
"sPaginationType": "full_numbers",
"sScrollX": "80%",
"sScrollXInner": "85%",
"bScrollCollapse": true,
"iDisplayLength": 20,
"aLengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]],
//"sDom": '<"H"Tfr>t<"F"ip>',
//<!--"sDom": 'T<"clear">lfrtip',-->
"sDom": '<"top"iflpT<"clear">>rt<"bottom"iflpT<"clear">>',
"oTableTools": {
"aButtons": [
{
"sExtends": "csv",
"sButtonText": "Save a CSV file!",
"sFileName": "*.csv",
"bBomInc": true,
"bFooter": false,
"bHeader": true,
"sCharSet": "utf16le",
"sFieldBoundary": '"',
"sFieldSeperator": ",",
"sNewLine": "auto",
//"sAction": "flash_save",
"fnClick": function ( nButton, oConfig, oFlash ) {
alert( 'Mouse click' );
}
}
]
},

});

});
[/code]

How do i get the click event of the csv button get fired? Am i doing any wrong thing in initializing or have i missed out something? Please help me out

Replies

  • shrinidhi_hashrinidhi_ha Posts: 6Questions: 0Answers: 0
    When i change the sExtends property to text the click event is getting fired but the same is not happening when i change the sExtends property to csv with all other properties being set as given in the code snippet.

    i am unable to figure out what mistake i am doing here?
  • allanallan Posts: 61,439Questions: 1Answers: 10,053 Site admin
    Link to a test case showing the issue please.

    Allan
  • shrinidhi_hashrinidhi_ha Posts: 6Questions: 0Answers: 0
    Test case:

    i have a html page with more than 70 rows of table data at present, but later this scenario might change, we might have more data as well. So I was planning to export the table data to csv file on the client side itself.

    if you feel the input test case given is not good enough please let me know i will try to share the complete html page code as well.

    i got a chance to look into the tabletools plugin from this forum and then i used it.

    i am testing is trying to export the table data to CSV file with TableTools Plugin.

    I came to know about this tool from this forums itself. Recently i got to know that table tools works on Flash Player. So i downloaded Adobe Flash player 11 and installed in the system, but even then the Export to CSV file option is not working.

    I feel like i am missing something here, i am not able to find out what i am missing out here.
  • shrinidhi_hashrinidhi_ha Posts: 6Questions: 0Answers: 0
    [code]







    <!--
    div.dataTables_wrapper { font-size: 13px; }
    table.display thead th, table.display tfoot th, table.display td { font-size: 10px; }
    -->





    $(document).ready(function() {
    //<!--TableTools.DEFAULTS.aButtons = [ "copy", "csv", "xls" ];-->
    TableTools.buttonBase.sTag = 'button';
    $('#results').dataTable( {
    "bFilter":false,
    "bJQueryUI": false,
    "sPaginationType": "full_numbers",
    "sScrollX": "80%",
    "sScrollXInner": "85%",
    "bScrollCollapse": true,
    "iDisplayLength": 20,
    "aLengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]],
    //"sDom": '<"H"Tfr>t<"F"ip>',
    //<!--"sDom": 'T<"clear">lfrtip',-->
    "sDom": '<"top"iflpT<"clear">>rt<"bottom"iflpT<"clear">>',
    "oTableTools": {
    "aButtons": [
    {
    "sExtends": "xls",
    "sButtonText": "Save a CSV file!",
    "sFileName": "*.csv",
    "bBomInc": true,
    "bFooter": false,
    "bHeader": true,
    "sCharSet": "utf16le",
    "sFieldBoundary": '"',
    "sFieldSeperator": ",",
    "sNewLine": "auto",
    //"sAction": "flash_save",
    "fnClick": function ( nButton, oConfig, oFlash ) {
    alert( 'Mouse click' );
    }
    }
    ]
    },

    });

    });



    head part of the html code

    [/code]
  • shrinidhi_hashrinidhi_ha Posts: 6Questions: 0Answers: 0
    body of the html page
    [code]




    procedure











    Document No
    Revision (Seq)
    Issued Date
    Job No
    Plant Code
    Item Code
    Publisher (Issued By)
    Title (Category Name)
    Number of Regular Inspection / Year
    Regular Inspection Year
    Word
    Comments
    Serial No
    Revision History Package
    Cassette
    Data Server
    Frequency
    Turbine Type
    Output
    Customer Name
    Last Stage





    PS-KS05849















































    [/code]
  • shrinidhi_hashrinidhi_ha Posts: 6Questions: 0Answers: 0
    debug code bookmarklet: ebinec
This discussion has been closed.