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
Below, is what I did to get altered html text in column cell, given a certain value in the aaData object array. This works, but feels horrible because html markup is in the javascript as above.
var dataTableMeta = { "bProcessing": true,
"bServerSide": true,
"sAjaxSource": url
, "aoColumns": aoColumns
, "fnServerData": function (sSource, aoData, fnCallback) {
$.ajax({ "dataType": 'json', "type": "POST", "url": sSource, "data": aoData, "success": fnCallback,
'dataFilter': function (data, type) {
var jsObject = jQuery.parseJSON(data);
for (var i = 0; i < jsObject.aaData.length; i++) {
jsObject.aaData[i].CaseID = '' + jsObject.aaData[i].CaseID + '';
}
var jsonString = JSON.stringify(jsObject);
return jsonString;
}
});
}
};
$('#caseSearchTable').dataTable(dataTableMeta);