Datatables can export to a CSV File this example has 2 table headers not displayed

I needed to export data from a table that is not visable to a CSV file this example does that it also sorts the date and currency fields correctly

Datatables can be downloaded Datatables

Result

Rendering engine Browser Platform(s) Engine version CSS grade Date Format Price
Rendering engine Browser Platform(s) Engine version CSS grade Date Format Price
Trident Internet Explorer 4.0 Win 95+ (Entity: &) 4 X 01/06/2011 £34.06
Trident Internet Explorer 5.0 Win 95+ 5 C 12/05/2009 £0.05
Trident Internet Explorer 5.5 Win 95+ 5.5 A 18/12/2012 £1.37
Trident Internet Explorer 6 Win 98+ 6 A 12/05/2006 £64.23
Trident Internet Explorer 7 Win XP SP2+ 7 A 30/11/2011 £67.23
Trident AOL browser (AOL desktop) Win XP 6 A 26/07/2012 £576.99
Gecko (UTF-8: $¢€ היצוא) Firefox 1.0 Win 98+ / OSX.2+ 1.7 A 01/01/2013 £43.56
Gecko Firefox 1.5 Win 98+ / OSX.2+ 1.8 A 27/12/2011 £2.34
Gecko Firefox 2.0 Win 98+ / OSX.2+ 1.8 A 03/08/2010 £9.99
Gecko Firefox 3.0 Win 2k+ / OSX.3+ 1.9 A 19/06/2005 £3.99
Gecko Camino 1.0 OSX.2+ 1.8 A 12/01/2009 £19.99
Gecko Camino 1.5 OSX.3+ 1.8 A 24/07/2012 £12.99
Gecko Netscape 7.2 Win 95+ / Mac OS 8.6-9.2 1.7 A 12/05/2011 £12.34
Gecko Netscape Browser 8 Win 98SE+ 1.7 A 12/05/2011 £24.12
Gecko Netscape Navigator 9 Win 98+ / OSX.2+ 1.8 A 12/05/2011 £78.99
Gecko Mozilla 1.0 Win 95+ / OSX.1+ 1 A 12/05/2011 £1232.56
Gecko Mozilla 1.1 Win 95+ / OSX.1+ 1.1 A 12/05/2011 £1.99
Gecko Mozilla 1.2 Win 95+ / OSX.1+ 1.2 A 12/05/2011 £2.99
Gecko Mozilla 1.3 Win 95+ / OSX.1+ 1.3 A 12/05/2011 £4.99
Gecko Mozilla 1.4 Win 95+ / OSX.1+ 1.4 A 12/05/2011 £2.78
Gecko Mozilla 1.5 Win 95+ / OSX.1+ 1.5 A 12/05/2011 £34.21
Gecko Mozilla 1.6 Win 95+ / OSX.1+ 1.6 A 12/05/2011 £16.72
Gecko Mozilla 1.7 Win 98+ / OSX.1+ 1.7 A 12/05/2011 £9.12
Gecko Mozilla 1.8 Win 98+ / OSX.1+ 1.8 A 12/05/2011 £1.92
Gecko Seamonkey 1.1 Win 98+ / OSX.2+ 1.8 A 12/05/2011 £2.65
Gecko Epiphany 2.20 Gnome 1.8 A 12/05/2011 £23.54
Webkit Safari 1.2 OSX.3 125.5 A 12/05/2011 £7.32
Webkit Safari 1.3 OSX.3 312.8 A 12/05/2011 £9.21
Webkit Safari 2.0 OSX.4+ 419.3 A 12/05/2011 £98.41
Webkit Safari 3.0 OSX.4+ 522.1 A 12/05/2011 £29.00
Webkit OmniWeb 5.5 OSX.4+ 420 A 12/05/2011 £145.63
Webkit iPod Touch / iPhone iPod 420.1 A 12/05/2011 £12.31
Webkit S60 S60 413 A 12/05/2011 £93.56
Presto Opera 7.0 Win 95+ / OSX.1+ - A 12/05/2011 £28.17
Presto Opera 7.5 Win 95+ / OSX.2+ - A 12/05/2011 £7.23
Presto Opera 8.0 Win 95+ / OSX.2+ - A 12/05/2011 £89.42
Presto Opera 8.5 Win 95+ / OSX.2+ - A 12/05/2011 £94.23
Presto Opera 9.0 Win 95+ / OSX.3+ - A 12/05/2011 £76.64
Presto Opera 9.2 Win 88+ / OSX.3+ - A 12/05/2011 £23.34
Presto Opera 9.5 Win 88+ / OSX.3+ - A 12/05/2011 £83.34
Presto Opera for Wii Wii - A 12/05/2011 £67.54
Presto Nokia N800 N800 - A 12/05/2011 £168.58
Presto Nintendo DS browser Nintendo DS 8.5 C/A1 12/05/2011 £98.65
KHTML Konqureror 3.1 KDE 3.1 3.1 C 12/05/2011 £356.36
KHTML Konqureror 3.3 KDE 3.3 3.3 A 12/05/2011 £455.23
KHTML Konqureror 3.5 KDE 3.5 3.5 A 12/05/2011 £845.43
Tasman Internet Explorer 4.5 Mac OS 8-9 - X 12/05/2011 £392.67
Tasman Internet Explorer 5.1 Mac OS 7.6-9 1 C 12/05/2011 £834.74
Tasman Internet Explorer 5.2 Mac OS 8-X 1 C 12/05/2011 £923.12
Misc NetFront 3.1 Embedded devices - C 12/05/2011 £179.76
Misc NetFront 3.4 Embedded devices - A 12/05/2011 £45.02
Misc Dillo 0.8 Embedded devices - X 12/05/2011 £67.89
Misc Links Text only - X 12/05/2011 £111.11
Misc Lynx Text only - X 12/05/2011 £95.99
Misc IE Mobile Windows Mobile 6 - C 12/05/2011 £44.23
Misc PSP browser PSP - C 12/05/2011 £163.67
Other browsers All others - - U 12/05/2011 £1.01
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  <html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <link rel="shortcut icon" type="image/ico" href="http://www.sprymedia.co.uk/media/images/favicon.ico">
  
  <title>TableTools example</title>
  <style type="text/css" title="currentStyle">
  @import "media/css/demo_page.css";
  @import "media/css/demo_table.css";
  @import "media/css/TableTools.css";
  </style>
  <script type="text/javascript" charset="utf-8" src="media/js/jquery.js"></script>
  <script type="text/javascript" charset="utf-8" src="media/js/jquery.dataTables.js"></script>
  <script type="text/javascript" charset="utf-8" src="media/js/ZeroClipboard.js"></script>
  <script type="text/javascript" charset="utf-8" src="media/js/TableTools.js"></script>
  <script type="text/javascript" charset="utf-8">
  $(document).ready( function () {
  $('#example').dataTable( {
  "aoColumns": [ //hides tables
  /* Engine */   null,
  /* Browser */  null,
  /* Platform */ { "bSearchable": false,
  "bVisible":    false },
  /* Version */  { "bVisible":    false },
  /* Grade */    null,
  null,
  null
  ],//ends hide tables
 "sPaginationType": "full_numbers",

 "sDom": 'T<"clear">lfrtip',
  "aoColumnDefs" : [
 {"aTargets" : [5] , "sType" : "uk_date" },
 
  ] 

 } );
  } );
  </script>
  </style>
  </head>
  <body id="dt_example">
  <div id="container">
  
  <div id="demo">
  <table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
  <thead>
  <tr>
  <th>Rendering engine</th>
  <th>Browser</th>
  <th>Platform(s)</th>
  <th>Engine version</th>
  <th>CSS grade</th>
  <th>Date Format</th>
  <th>Price</th>
  </tr>
  </thead>
  <tfoot>
  <tr>
  <th>Rendering engine</th>
  <th>Browser</th>
  <th>Platform(s)</th>
  <th>Engine version</th>
  <th>CSS grade</th>
  <th>Date Format</th>
  <th>Price</th>
  </tr>
  </tfoot>
  <tbody>
  <tr class="odd_gradeX">
  <td>Trident</td>
  <td>Internet Explorer 4.0</td>
  <td>Win 95+ (Entity: &amp;)</td>
  <td class="center">4</td>
  <td class="center">X</td>
  <td>01/06/2011</td>
  <td>&pound;34.06</td>
  </tr>
  <tr class="even_gradeC">
  <td>Trident</td>
  <td>Internet Explorer 5.0</td>
  <td>Win 95+</td>
  <td class="center">5</td>
  <td class="center">C</td>
  <td>12/05/2009</td>
  <td>&pound;0.05</td>
  </tr>
  <tr class="odd_gradeA">
  <td>Trident</td>
  <td>Internet Explorer 5.5</td>
  <td>Win 95+</td>
  <td class="center">5.5</td>
  <td class="center">A</td>
  <td>18/12/2012</td>
  <td>&pound;1.37</td>
  </tr>
  <tr class="even_gradeA">
  <td>Trident</td>
  <td>Internet Explorer 6</td>
  <td>Win 98+</td>
  <td class="center">6</td>
  <td class="center">A</td>
  <td>12/05/2006</td>
  <td>&pound;64.23</td>
  </tr>
  <tr class="odd_gradeA">
  <td>Trident</td>
  <td>Internet Explorer 7</td>
  <td>Win XP SP2+</td>
  <td class="center">7</td>
  <td class="center">A</td>
  <td>30/11/2011</td>
  <td>&pound;67.23</td>
  </tr>
  <tr class="even_gradeA">
  <td>Trident</td>
  <td>AOL browser (AOL desktop)</td>
  <td>Win XP</td>
  <td class="center">6</td>
  <td class="center">A</td>
  <td>26/07/2012</td>
  <td>&pound;576.99</td>
  </tr>
  <tr class="odd_gradeA">
  <td>Gecko (UTF-8: $¢€ היצוא)</td>
  <td>Firefox 1.0</td>
  <td>Win 98+ / OSX.2+</td>
  <td class="center">1.7</td>
  <td class="center">A</td>
  <td>01/01/2013</td>
  <td>&pound;43.56</td>
  </tr>
  <tr class="even_gradeA">
  <td>Gecko</td>
  <td>Firefox 1.5</td>
  <td>Win 98+ / OSX.2+</td>
  <td class="center">1.8</td>
  <td class="center">A</td>
  <td>27/12/2011</td>
  <td>&pound;2.34</td> 
  </tr>
  <tr class="odd_gradeA">
  <td>Gecko</td>
  <td>Firefox 2.0</td>
  <td>Win 98+ / OSX.2+</td>
  <td class="center">1.8</td>
  <td class="center">A</td>
  <td>03/08/2010</td>
  <td>&pound;9.99</td>
  </tr>
  <tr class="even_gradeA">
  <td>Gecko</td>
  <td>Firefox 3.0</td>
  <td>Win 2k+ / OSX.3+</td>
  <td class="center">1.9</td>
  <td class="center">A</td>
  <td>19/06/2005</td>
  <td>&pound;3.99</td>
  </tr>
  <tr class="odd_gradeA">
  <td>Gecko</td>
  <td>Camino 1.0</td>
  <td>OSX.2+</td>
  <td class="center">1.8</td>
  <td class="center">A</td>
  <td>12/01/2009</td>
  <td>&pound;19.99</td>
  </tr>
  <tr class="even_gradeA">
  <td>Gecko</td>
  <td>Camino 1.5</td>
  <td>OSX.3+</td>
  <td class="center">1.8</td>
  <td class="center">A</td>
  <td>24/07/2012</td>
  <td>&pound;12.99</td>
  </tr>
  <tr class="odd_gradeA">
  <td>Gecko</td>
  <td>Netscape 7.2</td>
  <td>Win 95+ / Mac OS 8.6-9.2</td>
  <td class="center">1.7</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;12.34</td>
  </tr>
  <tr class="even_gradeA">
  <td>Gecko</td>
  <td>Netscape Browser 8</td>
  <td>Win 98SE+</td>
  <td class="center">1.7</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;24.12</td>
  </tr>
  <tr class="odd_gradeA">
  <td>Gecko</td>
  <td>Netscape Navigator 9</td>
  <td>Win 98+ / OSX.2+</td>
  <td class="center">1.8</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;78.99</td>
  </tr>
  <tr class="even_gradeA">
  <td>Gecko</td>
  <td>Mozilla 1.0</td>
  <td>Win 95+ / OSX.1+</td>
  <td class="center">1</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;1232.56</td>
  </tr>
  <tr class="odd_gradeA">
  <td>Gecko</td>
  <td>Mozilla 1.1</td>
  <td>Win 95+ / OSX.1+</td>
  <td class="center">1.1</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;1.99</td>
  </tr>
  <tr class="even_gradeA">
  <td>Gecko</td>
  <td>Mozilla 1.2</td>
  <td>Win 95+ / OSX.1+</td>
  <td class="center">1.2</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;2.99</td>
  </tr>
  <tr class="odd_gradeA">
  <td>Gecko</td>
  <td>Mozilla 1.3</td>
  <td>Win 95+ / OSX.1+</td>
  <td class="center">1.3</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;4.99</td>
  </tr>
  <tr class="even_gradeA">
  <td>Gecko</td>
  <td>Mozilla 1.4</td>
  <td>Win 95+ / OSX.1+</td>
  <td class="center">1.4</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;2.78</td>
  </tr>
  <tr class="odd_gradeA">
  <td>Gecko</td>
  <td>Mozilla 1.5</td>
  <td>Win 95+ / OSX.1+</td>
  <td class="center">1.5</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;34.21</td>
  </tr>
  <tr class="even_gradeA">
  <td>Gecko</td>
  <td>Mozilla 1.6</td>
  <td>Win 95+ / OSX.1+</td>
  <td class="center">1.6</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;16.72</td>
  </tr>
  <tr class="odd_gradeA">
  <td>Gecko</td>
  <td>Mozilla 1.7</td>
  <td>Win 98+ / OSX.1+</td>
  <td class="center">1.7</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;9.12</td>
  </tr>
  <tr class="even_gradeA">
  <td>Gecko</td>
  <td>Mozilla 1.8</td>
  <td>Win 98+ / OSX.1+</td>
  <td class="center">1.8</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;1.92</td>
  </tr>
  <tr class="odd_gradeA">
  <td>Gecko</td>
  <td>Seamonkey 1.1</td>
  <td>Win 98+ / OSX.2+</td>
  <td class="center">1.8</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;2.65</td>
  </tr>
  <tr class="even_gradeA">
  <td>Gecko</td>
  <td>Epiphany 2.20</td>
  <td>Gnome</td>
  <td class="center">1.8</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;23.54</td>
  </tr>
  <tr class="odd_gradeA">
  <td>Webkit</td>
  <td>Safari 1.2</td>
  <td>OSX.3</td>
  <td class="center">125.5</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;7.32</td>
  </tr>
  <tr class="even_gradeA">
  <td>Webkit</td>
  <td>Safari 1.3</td>
  <td>OSX.3</td>
  <td class="center">312.8</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;9.21</td>
  </tr>
  <tr class="odd_gradeA">
  <td>Webkit</td>
  <td>Safari 2.0</td>
  <td>OSX.4+</td>
  <td class="center">419.3</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;98.41</td>
  </tr>
  <tr class="even_gradeA">
  <td>Webkit</td>
  <td>Safari 3.0</td>
  <td>OSX.4+</td>
  <td class="center">522.1</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;29.00</td>
  </tr>
  <tr class="odd_gradeA">
  <td>Webkit</td>
  <td>OmniWeb 5.5</td>
  <td>OSX.4+</td>
  <td class="center">420</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;145.63</td>
  </tr>
  <tr class="even_gradeA">
  <td>Webkit</td>
  <td>iPod Touch / iPhone</td>
  <td>iPod</td>
  <td class="center">420.1</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;12.31</td>
  </tr>
  <tr class="odd_gradeA">
  <td>Webkit</td>
  <td>S60</td>
  <td>S60</td>
  <td class="center">413</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;93.56</td>
  </tr>
  <tr class="even_gradeA">
  <td>Presto</td>
  <td>Opera 7.0</td>
  <td>Win 95+ / OSX.1+</td>
  <td class="center">-</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;28.17</td>
  </tr>
  <tr class="odd_gradeA">
  <td>Presto</td>
  <td>Opera 7.5</td>
  <td>Win 95+ / OSX.2+</td>
  <td class="center">-</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;7.23</td>
  </tr>
  <tr class="even_gradeA">
  <td>Presto</td>
  <td>Opera 8.0</td>
  <td>Win 95+ / OSX.2+</td>
  <td class="center">-</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;89.42</td>
  </tr>
  <tr class="odd_gradeA">
  <td>Presto</td>
  <td>Opera 8.5</td>
  <td>Win 95+ / OSX.2+</td>
  <td class="center">-</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;94.23</td>
  </tr>
  <tr class="even_gradeA">
  <td>Presto</td>
  <td>Opera 9.0</td>
  <td>Win 95+ / OSX.3+</td>
  <td class="center">-</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;76.64</td>
  </tr>
  <tr class="odd_gradeA">
  <td>Presto</td>
  <td>Opera 9.2</td>
  <td>Win 88+ / OSX.3+</td>
  <td class="center">-</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;23.34</td>
  </tr>
  <tr class="even_gradeA">
  <td>Presto</td>
  <td>Opera 9.5</td>
  <td>Win 88+ / OSX.3+</td>
  <td class="center">-</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;83.34</td>
  </tr>
  <tr class="odd_gradeA">
  <td>Presto</td>
  <td>Opera for Wii</td>
  <td>Wii</td>
  <td class="center">-</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;67.54</td>
  </tr>
  <tr class="even_gradeA">
  <td>Presto</td>
  <td>Nokia N800</td>
  <td>N800</td>
  <td class="center">-</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;168.58</td>
  </tr>
  <tr class="odd_gradeA">
  <td>Presto</td>
  <td>Nintendo DS browser</td>
  <td>Nintendo DS</td>
  <td class="center">8.5</td>
  <td class="center">C/A<sup>1</sup></td>
  <td>12/05/2011</td>
  <td>&pound;98.65</td>
  </tr>
  <tr class="even_gradeC">
  <td>KHTML</td>
  <td>Konqureror 3.1</td>
  <td>KDE 3.1</td>
  <td class="center">3.1</td>
  <td class="center">C</td>
  <td>12/05/2011</td>
  <td>&pound;356.36</td>
  </tr>
  <tr class="odd_gradeA">
  <td>KHTML</td>
  <td>Konqureror 3.3</td>
  <td>KDE 3.3</td>
  <td class="center">3.3</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;455.23</td>
  </tr>
  <tr class="even_gradeA">
  <td>KHTML</td>
  <td>Konqureror 3.5</td>
  <td>KDE 3.5</td>
  <td class="center">3.5</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;845.43</td>
  </tr>
  <tr class="odd_gradeX">
  <td>Tasman</td>
  <td>Internet Explorer 4.5</td>
  <td>Mac OS 8-9</td>
  <td class="center">-</td>
  <td class="center">X</td>
  <td>12/05/2011</td>
  <td>&pound;392.67</td>
  </tr>
  <tr class="even_gradeC">
  <td>Tasman</td>
  <td>Internet Explorer 5.1</td>
  <td>Mac OS 7.6-9</td>
  <td class="center">1</td>
  <td class="center">C</td>
  <td>12/05/2011</td>
  <td>&pound;834.74</td>
  </tr>
  <tr class="odd_gradeC">
  <td>Tasman</td>
  <td>Internet Explorer 5.2</td>
  <td>Mac OS 8-X</td>
  <td class="center">1</td>
  <td class="center">C</td>
  <td>12/05/2011</td>
  <td>&pound;923.12</td>
  </tr>
  <tr class="even_gradeA">
  <td>Misc</td>
  <td>NetFront 3.1</td>
  <td>Embedded devices</td>
  <td class="center">-</td>
  <td class="center">C</td>
  <td>12/05/2011</td>
  <td>&pound;179.76</td>
  </tr>
  <tr class="odd_gradeA">
  <td>Misc</td>
  <td>NetFront 3.4</td>
  <td>Embedded devices</td>
  <td class="center">-</td>
  <td class="center">A</td>
  <td>12/05/2011</td>
  <td>&pound;45.02</td>
  </tr>
  <tr class="even_gradeX">
  <td>Misc</td>
  <td>Dillo 0.8</td>
  <td>Embedded devices</td>
  <td class="center">-</td>
  <td class="center">X</td>
  <td>12/05/2011</td>
  <td>&pound;67.89</td>
  </tr>
  <tr class="odd_gradeX">
  <td>Misc</td>
  <td>Links</td>
  <td>Text only</td>
  <td class="center">-</td>
  <td class="center">X</td>
  <td>12/05/2011</td>
  <td>&pound;111.11</td>
  </tr>
  <tr class="even_gradeX">
  <td>Misc</td>
  <td>Lynx</td>
  <td>Text only</td>
  <td class="center">-</td>
  <td class="center">X</td>
  <td>12/05/2011</td>
  <td>&pound;95.99</td>
  </tr>
  <tr class="odd_gradeC">
  <td>Misc</td>
  <td>IE Mobile</td>
  <td>Windows Mobile 6</td>
  <td class="center">-</td>
  <td class="center">C</td>
  <td>12/05/2011</td>
  <td>&pound;44.23</td>
  </tr>
  <tr class="even_gradeC">
  <td>Misc</td>
  <td>PSP browser</td>
  <td>PSP</td>
  <td class="center">-</td>
  <td class="center">C</td>
  <td>12/05/2011</td>
  <td>&pound;163.67</td>
  </tr>
  <tr class="odd_gradeU">
  <td>Other browsers</td>
  <td>All others</td>
  <td>-</td>
  <td class="center">-</td>
  <td class="center">U</td>
  <td>12/05/2011</td>
  <td>&pound;1.01</td>
  </tr>
  </tbody>
  </table>
  </div>
  <div class="spacer"></div>
  </div>
  </div>
  <script type="text/javascript">
  // UK Date Sorting
  jQuery.fn.dataTableExt.oSort['uk_date-asc'] = function(a, b) {
  var ukDatea = a.split('/');
  var ukDateb = b.split('/');
 var x = (ukDatea[2] + ukDatea[1] + ukDatea[0]) * 1;
  var y = (ukDateb[2] + ukDateb[1] + ukDateb[0]) * 1;
 return ((x < y) ? -1 : ((x > y) ? 1 : 0));
  };
jQuery.fn.dataTableExt.oSort['uk_date-desc'] = function(a, b) {
  var ukDatea = a.split('/');
  var ukDateb = b.split('/');
 var x = (ukDatea[2] + ukDatea[1] + ukDatea[0]) * 1;
  var y = (ukDateb[2] + ukDateb[1] + ukDateb[0]) * 1;
 return ((x < y) ? 1 : ((x > y) ? -1 : 0));
  };
jQuery.fn.dataTableExt.oSort['natural-asc']  = function(a,b) {
  return naturalSort(a,b);
  };
  
  jQuery.fn.dataTableExt.oSort['natural-desc'] = function(a,b) {
  return naturalSort(a,b) * -1;
  };
//currency
  jQuery.fn.dataTableExt.aTypes.unshift( 
  function ( sData ) 
  { 
  var deformatted = sData.replace(/[^\d\-\.\/a-zA-Z]/g,'');
  if ( $.isNumeric( deformatted ) ) {
  return 'formatted-num';
  }
  return null; 
  } 
  );

jQuery.fn.dataTableExt.oSort['formatted-num-asc'] = function(a,b) {
  /* Remove any formatting */
  var x = a.match(/\d/) ? a.replace( /[^\d\-\.]/g, "" ) : 0;
  var y = b.match(/\d/) ? b.replace( /[^\d\-\.]/g, "" ) : 0;
  
  /* Parse and return */
  return parseFloat(x) - parseFloat(y);
  };
  
  jQuery.fn.dataTableExt.oSort['formatted-num-desc'] = function(a,b) {
  var x = a.match(/\d/) ? a.replace( /[^\d\-\.]/g, "" ) : 0;
  var y = b.match(/\d/) ? b.replace( /[^\d\-\.]/g, "" ) : 0;
  
  return parseFloat(y) - parseFloat(x);
  };
  </script>
  </body>
  </html>

Available For Freelance:

I Am Available To Work For You Freelance, See My Skills To See If I Can Help Your Project, If I Can Help You Then Please Contact Me.

My Rates Start From £180 A Day, Discount Prices For Regular Clients And Work Over 3 Days.

I Started To Learn Web Development In 2008, I Did A Few Open University Courses While Working Full Time In The Building Trade, I Managed To Get A Diploma With Distinction

Request A Tutorial

If You Are Having Difficulty With The Development Of Your Website Or If You Are Just Starting Out Leaning Web Development And You Think I Can Help You Then Request A Tutorial, I Will Do My Best To Help You

I Dont Charge For My Services If I Can Help You With Something That Can Be Be Fixed In A Few Minutes.

Advertise

If You Would Like To Advertise On This Site Then Please Contact Me, You Will Be Given Login Details To See What Day And Where Clicks Have Come From.

Prices Start From £10 A Month With Discounts Available For 3 Months Or More.

You Can Either Send Me The Banner Advert That You Have Designed Or From £10 I Can Have Designer Design A Banner For You.

Please Leave A Comment And A Rating





image

Chris Gave This Code Rating

I needed to export data from a table that is not visable to a CSV file this example does that it also sorts the date and currency fields correctly hope it helps

www.codecaven.co.uk image 5.00 out of 5 based on 1 ratings. 1 user reviews.

My Skills:

  • PHP 5
  • JavaScript
  • Jquery
  • XHTML Validation
  • KineticJS
  • HTML5
  • CSS - CSS3
  • SEO

My Social Networks:

  • facebook youtube