noobie help (server side default sorting)

noobie help (server side default sorting)

thegenethegene Posts: 4Questions: 0Answers: 0
edited May 2012 in General
I'm trying to alter the default sorting settings for my table. I had it working with aaSorting, but then I switched to server side processing which didn't work w/ the aaSorting still set... so I took that out. How do I make it so the default sorting is desc instead of asc for the first column when using server side processing?

Thanks

Replies

  • allanallan Posts: 63,546Questions: 1Answers: 10,476 Site admin
    assorting should work just fine with server-side processing. Does sorting work after initialisation with server-side processing? Can you run your table through the debugger ( http://debug.datatables.net ) so I can see its configuration please?

    Allan
  • thegenethegene Posts: 4Questions: 0Answers: 0
    Ok. I ran it twice. The first code is azolag. It was run w/ configuration of the following.

    [code]
    $(document).ready(function() {
    $('#dietTable').dataTable( {
    "bProcessing": true,
    "bServerSide": true,
    "sAjaxSource": "serverProcessing.php"
    "aaSorting": [[ 0, "desc" ]]
    } );
    } );
    [/code]

    iribuf is code I ran after deleting the line "aaSorting": [[ 0, "desc"]]. Otherwise they are the same.
  • allanallan Posts: 63,546Questions: 1Answers: 10,476 Site admin
    You've got a JS syntax error on line 5 there - missing a comma. The debugger also shows that there are no tables initialised in the "azolag" debug - so I suspect your syntax error is also present on your page.

    Allan
  • thegenethegene Posts: 4Questions: 0Answers: 0
    Awww... bs. Thanks and sorry.
This discussion has been closed.