Reputation: 439
I read 100 data from Database, but I send only 10 data to DataTable. But I want use Server-side processing from http://www.datatables.net/usage/server-side.
My code is:
function prepareDataTable() {
$('#displayData').dataTable({
"iDisplayLength": 10,
"iDisplayStart": 20,
"aaData": Rows,
"iTotalRecords": 57,
"iTotalDisplayRecords": 57,
"bSort": false,
"bFilter": false,
"aoColumns": [
{ "mDataProp": "name" }
]
});
In Rows I have only 10 data. So I want use Ajax to pass next data. And I want:
Upvotes: 1
Views: 6096
Reputation: 16
You should first use server side script by which you can get the json format data then your code becomes more like the following:
$('#displayData').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "server_processing.php",
...etc option
});
In server_processing.php
, use options according to your requirements to get your data.
For more help see server side datatable.
Upvotes: 0