I have some Ajax data read into jQuery DataTables. Problem is I need to make the data in the first column into a hyperlink. As in
Option Use columnDefs.render option to display hyperlink in a cell dynamically. For example: See this jsFiddle for code and demonstration.
CAUSE
render should be sub-property of either columns or columnDefs.SOLUTION
var table = $('#cccr').DataTable({
/* ... skipepd other options ... */
columnDefs: [
{
targets: 0,
render: function ( data, type, row, meta ) {
if(type === 'display'){
data = '' + data + '';
}
return data;
}
}
]
});
DEMO