How do i add a link in a cell
How do i add a link in a cell
moec
Posts: 6Questions: 5Answers: 0
I'm trying to add a link to the last cell in my table. This is the code I'm trying to use. I need to use the empNum for the redirecting php page.
$(document).ready(function () {
var table = $('#example').DataTable({
paging: false,
"ajax": "includes/payroll.php",
"columns": [
{
"className": 'details-control',
"orderable": false,
"data": null,
"defaultContent": ''
},
{"data": "empNum"},
{"data": "empName"},
{"data": "appFlag"},
{"data": "unitRate"},
{"data": "salary"},
{"data": "hourly"},
{
"data": null,
"defaultContent": '<?php echo '<a href=EmployeeInfo.php?empNum='."empNum".'>Info';?>'
}
],
"order": [[1, 'asc']]
});
This discussion has been closed.
Answers
I just answered a question about that here, which might help. http://www.datatables.net/forums/discussion/25111/hyperlink-in-td