passing parameters to column render function
passing parameters to column render function
jasonblewis
Posts: 3Questions: 2Answers: 0
I want to make a function I can pass to DataTables for rendering columns, mainly so I can make a column a clickable link.
How can I pass not only the function name of the renderer but also a parameter, such as the target url?
I made an example showing how not to do it
http://jsfiddle.net/jasonblewis/u9en604m/
See lines 26-27
tia
This discussion has been closed.
Answers
So to answer my own question. I found this example:
https://datatables.net/forums/discussion/31944/how-to-pass-additional-meta-data-eg-template-to-the-column-render-function
which helped me sort out a solution, with a friends help.
http://jsfiddle.net/jasonblewis/u9en604m/4/
render : function (data, type, row) {
return '<a href="https://site_url/'+data[0]+'">'+data[0]+'</a>'
}