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

Problem with rendering a column

$
0
0

Hi

I have a problem with rendering a column. I need to convert my string into integer:

"columnDefs": [ {
"targets": 5,
"render": function ( data, type, row ) {
    return parseInt(data);
}

}],

The code works fine but I use dataTables to generate tables on multiple pages and for those pages where there are two columns, the whole table will not work. Is there a way I can make render work only for a table with a specific id? I have tried something like:

"columnDefs": [ {
"targets": 5,
"render": function ( data, type, row ) {
    if ( var table==='inventory_table' ) {
        return parseInt(data)};
     };

But it didn't work.


Viewing all articles
Browse latest Browse all 81909

Trending Articles



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