Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82136

TableTools 2.1.4 and fnRender

$
0
0
Hi,
I'm using DataTables 1.9.4 and TableTools 2.1.4 : really beautiful stuff.

Simple problem : to display numeric values as integers (no decimals), I have defined
    "aoColumnDefs": [ 
                {
                    "bUseRendered": false,
                    "fnRender": function ( o ) {
                        return o.oSettings.fnFormatNumber( parseInt( o.aData[ o.iDataColumn ] ) );
                    },
                    "aTargets": [ 7, 8 ]
                }                       
            ]

which works well.

However, when copying the table with TableTools Copy button, defined here
    "oTableTools": {
        "sSwfPath": "{!URLFOR($Resource.DataTables, 'extras/TableTools/media/swf/copy_csv_xls_pdf.swf')}",
        "aButtons": [
                {
                    "sExtends": "copy",
                    "bSelectedOnly": true
                }
         ]
     }

the integer data gets copied with "." decimal point and 1 decimal digit (0).


How can I get integers formatted correctly before Copy ?

Viewing all articles
Browse latest Browse all 82136

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>