Turn off table sorting

Turn off table sorting

pwigginspwiggins Posts: 4Questions: 3Answers: 0

I've seen several different way's to turn off table sorting. I don't want any type of sorting only the fixed header and columns.
This is where I called data tables with the latest try at getting rid of the sorting. My data comes back via an ajax call and builds the table within a javascript for loop. I'm getting an alert that I'm currently also trying to debug and then it resorts all of my data when it calls DataTables. I just want all of the sorting and classes disabled, but haven't figured out how yet.

        var table = $('#pc_table').DataTable( {
            scrollY:        "1000px",
            scrollX:        true,
            scrollCollapse: true,
            paging:         false

        });

        new $.fn.dataTable.FixedColumns( table, {
            leftColumns: 2,
            aoColumns : null

        } );

This question has an accepted answers - jump to answer

Answers

  • pwigginspwiggins Posts: 4Questions: 3Answers: 0
    edited January 2015

    as my luck goes after I asked the question I continued my research and found this moments later.

            var table = $('#pc_table').DataTable( {
                scrollY:        "1000px",
                scrollX:        true,
                scrollCollapse: true,
                paging:         false,
                "bSort": false
    
            });
    
  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin
    Answer ✓

    Heh - so it goes.

    For reference, all of the options are listed here. order is the 1.10 naming style option for this feature.

    Allan

This discussion has been closed.