I am using DataTables Server Side to generate a paginated table from my MySQL table.
I am trying to use the columnDefs option to turn the first column into hyperlinks based on the MySQL results, like so:
<td><a href="index.php?result=[mysql result]">[mysql result]</a></td>
This is the code I have written to initiate the DataTables table:
<script>
$(document).ready(function() {
$('#example').DataTable( {
"processing": true,
"serverSide": true,
"ajax": "includes/pull_2.php",
"columnsDefs": [
{
"targets": 0,
"render": function (data, type, full, meta) {
return "<a href=index.php?result=" + full[0] + ">" + full[0] +"</a>";
}
}
]
});
});
</script>
However, although the table is rendering without any errors, it is not making the first column a hyperlink as I expected. Does anybody know why this is not functioning as expected?
This is the table I am testing on: http://clients.serallo.co.uk/formtest/