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

same mRender function for multiple columns

$
0
0
I'm using mRender to provide a rendering function for two columns in a DataTable. However, I can't use the same aoColumnDefs entry for both columns, because they access different columns of the data source, and mData only allows me to specify one column index.

Do I really need to repeat the mRender declaration for each column, even when they use the same renderer function, like so?
    $('#vis').dataTable({
        'aoColumnDefs': [
             { 'mRender': rendererFunction, 'mData': 3, 'aTargets': [ 3 ] },
             { 'mRender': rendererFunction, 'mData': 4, 'aTargets': [ 4 ] },
        ]});

Viewing all articles
Browse latest Browse all 82132

Trending Articles



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