Did not work aoColumns mystring when using sAjaxSource

Did not work aoColumns mystring when using sAjaxSource

mizunekomizuneko Posts: 6Questions: 0Answers: 0
edited November 2012 in DataTables 1.9
I used mystring for null last sorting, but when I changed to use sAjaxSource, it didn't work.
In server side php code, server_processing.php, I could change ordering by sql ORDER BY function, so is it possible to add new column with number of records?

I have the record more then 100000, which is suitable sorting method, sql or aaSorting?

Replies

  • allanallan Posts: 63,394Questions: 1Answers: 10,450 Site admin
    For 100'000 records, server-side processing is probably worth while. With server-side processing, all sorting is done at the server, not in Javascript. So you would need to use ORDER BY or similar.

    Allan
  • mizunekomizuneko Posts: 6Questions: 0Answers: 0
    Thank you for quick reply!
    I used 'ORDER BY col1 IS NULL ASC' for mySQL and server_processing.php was working with that order. But in the table, records were ordered by normal ASC order, so I excluded "aaSorting", and added "bSortClasses": false, but it didn't work.

    My script for example...

    $(document).ready(function() {
    $('#table_all').dataTable( {
    "sPaginationType": "full_numbers",
    "aLengthMenu": [[10, 50, -1], [10, 50, "All"]],
    //"aaSorting": [[ 0, 'asc' ], [ 1, 'asc' ], [ 3, 'asc' ]],
    "bServerSide": true,
    "sAjaxSource": "server_processing.php",
    "bDeferRender" : true,
    "bSortClasses": false,
    // forms ( l - Length changing, p - Pagination, i - Information)
    "sDom": '<"top"ilT<"clear">>"bottom"p'

    } );
    } );
This discussion has been closed.