Server side pagination and filter not working v 1.10
Server side pagination and filter not working v 1.10
FireFoxII
Posts: 17Questions: 10Answers: 0
HI and sorry for my english...
I'm using a simple server-side script with a 3 column datatables but I can't get pagination and filter working...
This is my simply datatables setup
<table id="table" class="table table-bordered table-striped">
<thead>
<tr>
<th>id</th>
<th>cognome</th>
<th>nome</th>
</tr>
</thead>
</table>
......................
$(document).ready(function() {
$('#table').DataTable( {
"processing": true,
"serverSide": true,
"ajax": "scripts/prova2.php"
} );
} );
This is a sample of return data from network in chrome console
{sEcho: 0, iTotalRecords: "1134", iTotalDisplayRecords: "1134",…}
aaData: [["1", "DE SANTIS", "ONOFRIO "], ["2", "FORTUNATO ", "SANDRO"], ["3", "SANSEVERINO ", "ALFONSO"],…]
Seems that server script don't receive any data from client...
Thanks
This discussion has been closed.
Answers
Does your .php really handle server side requests? When using serverside, if you monitor the html response and requests, you should see that all the necessary values to generate the SQL is being passed to the ajax php page. How is your page then handling those fields? Most people do not require server side processing. dataTables can handle thousands of rows without ever going to serverside. I find serverSide useful only when I cannot return all my data in a single query. Limiting the display to 100 records or less is highly useful all the time.
Yes, now I'm working whitouth server-side but i would to implement this because query on database return lot of data and more every day...
The datatable become heavy and I must attend lot of time when load...
My purpose with server-side it's to implement a defer loading...
I accept other suggestion for what I must do :)
That is wrong.
sEcho
will never be zero - see the legacy server-side documentation:Allan
Ok, this is my fault...
But if I set
I always get the error that $_GET['sEcho'] was unknowed...
Are the parameters being sent as GET parameters, or have you configured it as POST? Another possibility is that you are not in fact using the legacy protocol, but the current one. Without a link to the page I'm afraid I'm just guessing.
Allan