Quantcast
Channel: DataTables 1.9 — DataTables forums
Viewing all articles
Browse latest Browse all 124

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?
[code]
$('#vis').dataTable({
'aoColumnDefs': [
{ 'mRender': rendererFunction, 'mData': 3, 'aTargets': [ 3 ] },
{ 'mRender': rendererFunction, 'mData': 4, 'aTargets': [ 4 ] },
]});
[/code]

Viewing all articles
Browse latest Browse all 124

Trending Articles