How can i export a table as a .txt file

How can i export a table as a .txt file

sathishsathish Posts: 6Questions: 0Answers: 0
edited June 2011 in TableTools
Hi ,
Using the tool i ve successfully exported the table as csv,pdf,excel...Thanx to the developer for such a nice tool.Now i need to export the table as a text file with any text editor like notepad,wordpad,etc...I ve tried the Text button in the buttons,but it isnt working...can someone assist me with this

Replies

  • GustGust Posts: 17Questions: 0Answers: 0
    Try this :

    $(document).ready( function () {
    $('#example').dataTable( {
    "sDom": 'T<"clear">lfrtip',
    "oTableTools": {
    "aButtons": [
    "text"
    ]
    }
    } );
    } );

    See "text" in this page :
    http://datatables.net/extras/tabletools/buttons

    And eventually you should do this to set the properties of you export button :

    $(document).ready( function () {
    $('#example').dataTable( {
    "sDom": 'T<"clear">lfrtip',
    "oTableTools": {
    "aButtons": [
    {
    "sExtends": "text",
    "sButtonText": "Hello world"
    }
    ]
    }
    } );
    } );

    Further information here :
    http://datatables.net/extras/tabletools/button_options

    Good luck.

    Gust
This discussion has been closed.