I am filling in a datatable
but I would like to measure the length of the array
that the query returns to me. In addition to this choose which elements of array
I want to show and which do not.
The code I use is the following
var data2 = JSON.stringify({
usuario: $('#h_user').val(),
estado: $('#MainContent_estado option:selected').text(),
buscarPor: $('#MainContent_buscarPor option:selected').text(),
fecha_ini: $('#MainContent_fechaIni').val(),
fecha_fin: $('#MainContent_fechaFin').val()
})
$('#datatable').DataTable({
'dom': 'Bfrtip',
'buttons': [
{
extend: 'excelHtml5', className: 'btn btn-primary', exportOptions: {
columns: ':visible'
}
},
{
extend: 'pdfHtml5', className: 'btn btn-primary', exportOptions: {
columns: ':visible'
}
},
{
extend: 'colvis', className: 'btn btn-primary', text: 'Columnas Visibles'
}
//'colvis'
],
"columnDefs": [ {
"targets": -1,
"visible": false
} ],
"autoWidth": true,
"ajax": {
"url": "http://vr.zom.com/extranete/WSo/Servicioss.svc/buscaReferes",
"type": "POST",
"contentType": "application/json; charset=utf-8",
"data": function (d) {
return data2
},
"error": function (jqXmlHttpRequest, textStatus, errorThrown) {
// alert("Datos Incorrectos"); //#coment
}
}
});
and if it works the datatable is filled with the data but now I want to filter which dobjects of the array show