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

How to get aTargets' array length?

$
0
0
I am using aoColumnDefs from the Datatable jQuery library. So I can use "aTargets": [1, 2] or such to define which column I want to change by this function. But my tables are dynamic, and I want to apply this function to all the columns except the first one. So how can I achieve this?
The code I used:
jQuery('.summary_tables').dataTable({
    "aoColumnDefs": [
     {
         "aTargets": [1,2,-1],
         "bUseRendered": false,
         "fnRender": function ( o ) {
             return o.oSettings.fnFormatNumber( parseInt( o.aData[ o.iDataColumn ] ) );
         }
     }
 ]
});

Viewing all articles
Browse latest Browse all 82018

Trending Articles



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