I\'m creating a dataTables table to use as an archive of pages for a site that produces a comic strip. On that archives page, I\'d like to have the title of the comic be a l
You could also use the mRender function with aoColumnDefs:
$('#example').dataTable({
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "archive/archive.txt",
"aoColumnDefs": [
{
"aTargets": [ 2 ], // Column to target
"mRender": function ( data, type, full ) {
// 'full' is the row's data object, and 'data' is this column's data
// e.g. 'full[0]' is the comic id, and 'data' is the comic title
return '' + data + '';
}
}
]
});
This is more explicit and likely more maintainable because you can specify how individual columns render at the column level, rather than selecting them through the DOM at the row level, which helps when you're adding columns later on.