columnDefs return url_for with parameter errors 'data' is undefined
columnDefs return url_for with parameter errors 'data' is undefined
CorbDJ
Posts: 6Questions: 2Answers: 2
I cannot seem to figure out what it is I'm doing wrong here. I'm not able to pass 'data' as a parameter in the url_for. If I directly assign a value to 'data' it works but it won't pull from the function. I'm assuming that I am making a formatting mistake but I honestly don't know.
$(document).ready(function() {
$('#table_data').DataTable(
{order: [[1, 'DESC']],
"columnDefs": [ {"targets": 0,
"data": "download_link",
"render": function ( data, type, row, meta ) {
return '<a src="{{ url_for('confirmation_page', data='+data+' ) }}">'+data+'</a>';}
} ] } );
});
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
This is one way to resolve the issue: