I am using datatables to show the information of my clients and some other useful fields, the datatable works perfectly, but now I need to create reports according to the query made with the searchable datatable.
through the method getElementsByTagName ('tr') .. I get the information of each value of the query column, but this method returns it to me as an html collection ... I need to be able to send that collection to the controller and it does not work, it does not recognize the information ... there is some way to do this what I have tried so far has not worked ... I am using laravel. I enclose the code thank you in advance ...
$("#omg").click(function() {
var info = document.getElementsByTagName('td');
var route= 'pdf/'+info+'/';
alert(info[0].innerHTML );
$.ajax({
url: route,
dataType: "JSON",
success: function(result)
{
console.log('done');
},
fail: function(){
console.log('fracaso');
}
});
});
$('#logs').DataTable({
"processing": true,
//"serverSide": true,
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
"language": {
"url": "//cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/Spanish.json"
},
});
the #omg is a one-button id with which reports are generated