-1

I am using CSV button in data table using table tools plugin.with this code only-

var table=$('#srvc_data_table').dataTable( {
        "data": dataSet,
        "columns": table_headings,
        "dom": 'T<"clear"><"H"lfr>t<"F"ip>',
        "tableTools": {     
        "sSwfPath": "../swf/copy_csv_xls_pdf.swf",        
        },
        });

button is declared in tableTools.js(tabletools plug-in file) as below ->

TableTools.BUTTONS = {
    "csv": $.extend( {}, TableTools.buttonBase, {
        "sAction": "flash_save",
        "sButtonClass": "DTTT_button_csv",
        "sButtonText": "CSV",
        "sFieldBoundary": '"',
        "sFieldSeperator": ",",
        "fnClick": function( nButton, oConfig, flash ) {
            this.fnSetText( flash, this.fnGetTableData(oConfig) );
        }
    } ),

CSV button is getting added on data table. But I dont want to place this button on table itself.I want this button on another toolbar. I want to detach the button from table or fire its click event from another button on different toolbar.Is it possible to fire fnClick event from another button.

1 Answers1

0

Try using the direct initialization method. You can then utilize the fnContainer() API method to insert your csv button into your document.

ie $( tableTools.fnContainer() ).insertAfter('div.info')

Latitude25
  • 11
  • 1