Wrong ordering script in server-side processing example

Wrong ordering script in server-side processing example

alampr87alampr87 Posts: 1Questions: 0Answers: 0
edited December 2012 in General
Hi everyone!

First of all, nice work!

I found a mistake in the examples section for server_side processing. The ordering algorithm does not work properly (tested with Version 1.9.4)

The old code
[code]
if ( isset( $_GET['iSortCol_0'] ) )
{
$sOrder = "ORDER BY ";
for ( $i=0 ; $i

Replies

  • allanallan Posts: 63,133Questions: 1Answers: 10,399 Site admin
    Your code might work, but it limits the sorting to a single column. It doesn't allow multi column sorting.

    Please link to a test case showing the problem:
    http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read

    My own example appears to work okay:
    http://datatables.net/release-datatables/examples/data_sources/server_side.html

    Allan
This discussion has been closed.