Data table column rendering with ajax response
Data table column rendering with ajax response
I am trying to render column contents with ajax response but it doesn't display anything in the column despite ajax response returning data,
{
"width": "20%","targets": 6,
"defaultContent": '',
"render": function ( data, type, row ) {
if(row.colData !=''){
$url="server request url";
var ret= row.colData
var aydGuid=row.guid;
var params = {relatedHID:ret,guid:aydGuid};
$.ajax({
url: $url,
async: true,
data: jQuery.param(params),
dataType:'html'
}).done(function( data ) {
alert(data) //displays response
return data //does nothing
});
}