Why does my datatable reload where I change length or start typing in filter input box?
Why does my datatable reload where I change length or start typing in filter input box?
![ebrunolopes](https://secure.gravatar.com/avatar/189553d9820aeb660f12523311bfe80e/?default=https%3A%2F%2Fvanillicon.com%2F189553d9820aeb660f12523311bfe80e_200.png&rating=g&size=120)
var tables = $.fn.dataTable.fnTables(true);
$(tables).each(function() {
$(this).dataTable().fnDestroy();
});
$('#tableoutrequisicoes').dataTable( {
"dom": "<'row'<'col-md-8 col-sm-12'l><'col-md-4 col-sm-12'>f><'table-scrollable't><'row'<'col-md-8 col-sm-12'i><'col-md-4 col-sm-12'p>r>", // datatable layout
"lengthMenu": [
[20, 50, 100, 150, -1],
[20, 50, 100, 150, "Tudo"]
],
"processing": true,
"serverSide": true,
"pageLength": 20,
"ajax": {
"type": "POST",
"url": Paths.init('units') + 'armazem/renderrequisicoes',
"data": function ( d ) {
d.query = $('#query').val();
d.reftipo = $('#rowsysdocumento').val();
d.serie = $('#serie').val();
d.numero= $('#numero').val();
}
},
"columnDefs": [
{
"targets": [0],
"visible": false,
"searchable": false
}
],
"order": [
[1, "asc"]
]
} );