No limit on serverside entries
No limit on serverside entries
Samul
Posts: 4Questions: 1Answers: 0
Hello
I have a table i'm loading data into but the full data set is showing rather than just 10 at a time.
So it says "Showing 1 to 10 of 3,486 entries" but it's showing all the entries. My code is below:
$(document).ready(function() {
$('#scheduleTable').DataTable( {
"autoWidth": false,
"processing": true,
"serverSide": true,
"paging": true,
"ajax": {
"url": "../json/jsonSchedule.php",
"type": "POST"
}
} );
} );
The table is populating correctly and there are no console errors.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Is there any kind of "limit" clause in your server-side code?
There isn't. From looking at the examples they didn't seem to have these... What would be my best method for getting this to work? Are there any examples on the site?
Thanks
The most basic example is here:
https://datatables.net/examples/server_side/simple.html
See under the "Server-side script" tab.
You'll also need the ssp.class.php file.
https://datatables.net//forums/discussion/41720
Note that the ssp class is only intended as an example. You may need more sophisticated stuff depending on your needs, but this would get you up and running.
I've seen this example and am already using ssp.class to generate my json. Will I have to customise the ssp class to do what i want?
If you are using server-side processing with your own server-side script, you will need to read this page.
However, you should perhaps first question if you need server-side processing: see here.
Allan
I did not need server-side processing. Thanks for the help guys.