DataTables logo DataTables

via Ad Packs
How to disable sorting
  • DataTables is fantastic, I am using it for our church. I do not want the table data to be sorted,
    It actually already is sorted by the books of the Bible. So, is it possible to disable the sorting?
    Will this effect the search in any way?
  • After searching I guess I set the aaSorting array to empty. My assumption is that its like this:
    "aaSorting": []
    Don't know if that is the proper syntax, but will give it a try.
  • Yep, that did the trick. To disable sorting completely I did this:

    $('#example').dataTable( {
    "bJQueryUI": true,
    "sPaginationType": "full_numbers",
    "aaSorting": []
    } );

    I had to add a comma after "full_numbers",
    and then I added the line:
    "aaSorting": []

    Thats all there was to it.
  • The correct (official) way is, I believe:
    $(document).ready( function () {
    	$('#example').dataTable( {
    		"bSort": false
    	} );
    } )
    

    see http://www.datatables.net/usage/features#bSort

    HTH
    ruzz
This discussion has been closed.
All Discussions