columns.render hyperlink
columns.render hyperlink
MontereyDean
Posts: 13Questions: 1Answers: 0
Hi! I'm okay creating hyperlinks using:
"columnDefs": [ {
"targets": 3,
"render": function ( data, type, full, meta ) {
return '<a href=\"docs/resolutions/'+data+'\" target=\"_blank\">PDF</a>';
}
} ]
"+data+" inserts the file name. But how would I insert the contents of a database column where the hyperlink text -- "PDF" -- is now? For example, "+data+" is the filename and I want to insert the document title, from the database instead of the static "PDF" text.
If the examples on the columns.render page explains this, I just don't understand it.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Sorry. I probably should have mentioned that I'm using server_processing.php and ssp.class.php scripts.
Is the data you want to display in the JSON returned from the server? If not, then you'd need to add it. If it is (or you add it), use the
full
parameter to access other data properties from the row.Allan
I'm not good enough at this yet to understand what you're talking about; so, I'll think of a different way of doing this. But I appreciate your time. Maybe it will help someone a little further along.