Export JQuery Datatble

Standard

 

stock_list  => Your Html Table Id

 

 $(‘#stock_list’).dataTable( {

       “sDom”: ‘T<“clear”>lfrtip’,

       “oTableTools”: {

“sSwfPath”: “//cdn.datatables.net/tabletools/2.2.2/swf/copy_csv_xls_pdf.swf”,

     “aButtons”: [{

       “sExtends”: “collection”,

       “sButtonText”: “Export”,

       “aButtons”: [

        {

           ‘sExtends’: “csv”,

              “sButtonText”: “Export to CSV”,

           },           

           {

               ‘sExtends’: “pdf”

           }            

       ],

   }],

}

});

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s