sorting_disabled on 6th column of dataTables

sorting_disabled on 6th column of dataTables

ewoahewoah Posts: 1Questions: 1Answers: 0
edited May 2018 in DataTables 1.10

For some reason the 6th columns of all my dataTables are getting disabled from sorting (sorting_disabled class on the thead > tr) My dataTable is using serverside processing / json. Below is the HTML / JS for my table. Any idea why?? (Attached screenshot below)

//Get Table Data
function loadTable(type){
    currentSection = $('#currentSection').val();
    url = '/'+currentSection+'/data';
  $('.ajax-table').DataTable( {
     "iDisplayLength": 25,
      "ordering": true,
      "processing": true,
      "serverSide": true,
      "ajax": url,
            "dataType":JSON,
      "initComplete": function(settings, json) {
      

      }
  });
}
<table class="table ajax-table table-clickable">
            <thead>
                <tr>
                    <th class="sorting_desc">ID</th>
                        <th>Truck#</th>
                        <th>Trailer</th>
                        <th>Type</th>
                        <th>Make</th>
                        <th>Model</th>
                        <th>Year</th>
                        <th>Trans</th>
                        <th>Base</th>
                        <th>Drivers</th>
                        <th>Status</th>
                        <th class="text-center">Actions</th>
                </tr>
            </thead>
        </table>


<thead>

After the table loads, the 6th columns of ALL my dataTables using this function are disabled from sorting? Makes no sense?

<th class="sorting_disabled" rowspan="1" colspan="1" aria-label="Model" style="width: 100px;">Model</th>

Answers

  • colincolin Posts: 15,143Questions: 1Answers: 2,586

    Hi @ewoah ,

    Yep, that definitely looks odd, there's no reason why that should be happening as you said. Would be able to link to a running page so we can take a look?

    Cheers,

    Colin

  • allanallan Posts: 61,715Questions: 1Answers: 10,106 Site admin

    You have server-side processing enabled, so ordering is being done by whatever script the url variable is pointing at. What is that script and what is the data type it is attempting to sort? As Colin says, a link to a test page showing the issue would be useful.

    Thanks,
    Allan

This discussion has been closed.