I am using DataTables to generate a table. There is a column containing order numbers.
For example: ...
I need every row in this column to have a hyperlink to
Check this out: http://datatables.net/reference/option/columns.render
You can add a column render callback when you specify columns definition.
var columnsDef = [
...
{
"title": "Order No.",
"render": function (data, type, row, meta) {
return '<a href="view/order?' + data + '">' + data + '</a>';
}
},
...
];
$("#table").dataTable({
...
"columns": columnsDef,
...
});
The data in that column will be changed to what the render function return.