length and start parameters in server side request
length and start parameters in server side request
mandete
Posts: 3Questions: 1Answers: 0
Hi, i'm trying to make a server side request with start and length paramets (i will only want to show the 3 first registers), but it doesn't work!.
I've tried with this two options:
option 1:
var table = $('#tablas').DataTable({
"ajax" :{
"url": "/include/scripts/script.php",
"start": 0,
"length": 3
},
"serverSide": true,
...
option 2:
var table = $('#tablas').DataTable({
"ajax" : "/include/scripts/script.php",
"start": 0,
"length": 3
"serverSide": true,
...
What can i do??
Thanks!!
This discussion has been closed.
Answers
Start and Length are sent by dataTables in the GET or POST to your ajax URL.
You configure with pageLength.
But i don't want paginate in this datatables, i only want receive the 3 first records and thats all. But i don't want to make this directly in the sql query because in other page i want the same query but receiving all the records.
Finally i make a normal server side request with paginate, limiting to 3 records by page and hidden via dom the paginate. In this way i can show only three first records and anything else ;)
Use
ajax.data
if you want to send additional data to the server.Allan