Why not refresh data after ajax
Why not refresh data after ajax

Data tables not run after load data from AJAX.
/* Data is additional to send with ajax petition */
var data = {tipo:'AgilPeticionLocalizador',id_empresa_sgw:$id_empresas,nombre_localizador:nombre_localizador}
$('#TablaLocalizador').dataTable({
"processing": false,
"serverSide": true,
"pageLength": 10,
"ajax": {
"url": "{{ url('ProcesaAjaxLocalizador') }}",
"dataType": 'json',
"data": data
}
});
And when show table data, it show all registers (100) and Nothing works: page, search, next page, etc.
What's my error?
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Structured data:
Columns:
Can you use the debugger to give me a trace please - click the Upload button and then let me know what the debug code is.
Also its not clear from the above, but if your returned
data
array is larger than 10, then the server-side script is doing the server-side processing wrong. It should only returned the records for the page.That said, you don't actually need server-side processing with only 1000 rows. Just remove
serverSide: true
.Allan
Ok, I have this paste code on Console Chrome. ¿What are " - click the upload button"?
OK. I Lookup the button. Have it.
What I need to do is:
From Ajax make requests to the server on an Articles table that can have thousands of records.
Initially I had thought to show the first 100, but then, when you paginate or search, go making requests of what was searched, ordered or paged.
I have a remote REST system where I make the requests, I don't have the table in the local PHP code, so I'm interested in passing all the parameters that DATATABLES requests in serverside: true. (Search, Filter, Length, Start, etc.)
I've made it work, but it doesn't work the way I want it to.
I've changed the order of the array data:
If recordsTotal and recordsFiltered have after DATA not work.
Allan said: