DataTables logo DataTables

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

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Support

Get useful and friendly help straight from the source.