pass hidden value in URL generated using Datatable
pass hidden value in URL generated using Datatable
I have below html. Here , the third heading is called "Control". This Control heading has an href link where I am trying to pass the value of EUDBID where EUDBID is an hidden field which I dont want to show in UI.
<tr>
<th class="centerTableContent myWhiteSpace">ID</th>
<th class="centerTableContent myWhiteSpace">EUDBID</th>
<th class="centerTableContent myWhiteSpace">Controls</th>
</tr>
Below is the js code which I tried to achieve this. But this is throwing datatable warning and not appending row.eudbid in the url.
jQuery('#example').DataTable({
"columns":[
{"data" : "id"},
{"data" : "eudbid","visible":false},
{"data" : null,
render : function(data,type,row){
return '<a href="view-database-type.cfm?eudbid=${row.eudbid}"></a>';
}
}
]
});
Can someone help me achieve this correctly.
This discussion has been closed.
Answers
The place to start is to tell us the error you are getting.
My guess is you need to remove
"data" : null,from the third column and replace it with"defaultContent: '',.If this doesn't help please provide a link to your page or a test case showing the issue,
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin