when I use server-side processing, need I pass back all rows to dataTable?

when I use server-side processing, need I pass back all rows to dataTable?

yogurt1206yogurt1206 Posts: 1Questions: 0Answers: 0
edited March 2014 in General
Hi, I'm a starter of dataTables. I have a question when create the php file for server-side processing.
Look at the codes below. If I set iDisplay=5 and the php file will return 10 entries. The php file will be called once or twice?
Thanks for your answers!
[code]
/*
* Paging
*/
$sLimit = "";
if ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )
{
$sLimit = "LIMIT ".intval( $_GET['iDisplayLength'] )." OFFSET ".
intval( $_GET['iDisplayStart'] );
}
[/code]

Replies

  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin
    > when I use server-side processing, need I pass back all rows to dataTable?

    No. The whole point of server-side processing is that you only pass back the rows that DataTables asks for. This allows it to very easily cope with showing just 10 rows from 20 million for example...

    See the documentation here: http://next.datatables.net/manual/data#Processing-modes

    Allan
This discussion has been closed.