Make all data in a column to a hyperlink ()
Make all data in a column to a hyperlink ()
runner
Posts: 1Questions: 0Answers: 0
Hi!
I'm using the following code to fetch data using PHP from a MySQL database which works just fine:
$('#my-table').dataTable({
"bProcessing": true,
"sAjaxSource": "pro.php",
"aoColumns": [
{ mData: 'id' } ,
{ mData: 'username' },
{ mData: 'domain' },
]
});
All the data in the domain column are domain name (eg. example.com) and i want them to be rendered inside an anchor tag element <a href="example.com">blah</a>.
Is that possible to do with the Javascript code I use above?
I've tried looking in to the render documentation but don't really get it. Any help would be appreciated.
Thanks!
This discussion has been closed.
Replies
Hi @runner ,
Take a look at the fourth example on
columns.render
, that's doing exactly what you're after,Cheers,
Colin