Targeting Two Columns to Use mRender On

Targeting Two Columns to Use mRender On

andydeforestandydeforest Posts: 2Questions: 0Answers: 0
edited September 2012 in General
Hello,

I have something like this on my website:
[code]
$(document).ready(function(){
var oTable = $('#tableDisp').dataTable({
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "data-tables/sources/pending.php",
"aoColumnDefs": [
{
"aTargets": [ 5 ],
"mRender": function ( data, type, full ) {
var identifier = data;
var retStr = '1';
retStr += ' | 2';
retStr += ' | 3';
return retStr;
}
}
]
});
});
[/code]

I'm a little new to DataTables, so I was wondering if anyone could help me out with this. How do I go about modifying a second column along the one I have already modified (column 5)? I've been playing around with this, but I can't seem to get it right. Any help appreciated!

Replies

  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    The mRender is column discrete - i.e. the rendering method for one column can't effect the rendering of other columns. You simply need to have two different rendering methods if you want to render two columns in different ways.

    Allan
This discussion has been closed.