Server Processing Mode DESC

Server Processing Mode DESC

macmicromacmicro Posts: 19Questions: 0Answers: 0
edited February 2012 in General
Hello,
I am French, I translated the code for you with Google
I have a MYSQL table containing 12 recordings, ranging from 1 to 12 id


In this page I use this

"sAjaxSource": "server_processing.php", dans la fonction javascript.


server_processing.php the page, I use this code
http://datatables.net/release-datatables/examples/data_sources/server_side.html

It works fine but my table shows records 1 to 12 and I wish we had from 12 to 1

is an ORDER BY DESC

but nothing in this code indicates that the ability to add parameters except this
string sSortDir_(int) Direction to be sorted - "desc" or "asc".

that is on this page http://datatables.net/usage/server-side


So in the original code
[code]
/*CODE ORIGINAL*/
$sOrder = "";
if ( isset( $_GET['iSortCol_0'] ) )
{
$sOrder = "ORDER BY ";
for ( $i=0 ; $i

Replies

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Am I correct in saying that you want descending sorting by default, rather than ascending? All your code is doing it flipping the two around - which is fair enough, but I suspect will be very confusing in future. What I would suggest doing is using the asSorting option for columns to define the sorting priority order that you want.

    Allan
  • macmicromacmicro Posts: 19Questions: 0Answers: 0
    Hello,
    Actually, I just tried with the option asSorting is it's easier to parameterize
    thank you
This discussion has been closed.