Making a column not sortable removes header text

Making a column not sortable removes header text

MapleThunderMapleThunder Posts: 4Questions: 2Answers: 0

I want to make a column in my table not be sortable, so I have added the following into the table definition:

"bProcessing":true,
"bServerSide": true,
"sAjaxSource": '/spectrometer/search',
"iDisplayLength": 10,
"aoColumnDefs": [{
        "bSortable": false,
        "aTargets": [1]
}],
"aoColumns": [{ .. multiple columns here ..}]

This removes the sorting on the desired column, but it also blacks out the text in the header. I can highlight the text to see it, but it isn't white like the rest of the column headers.

Answers

  • allanallan Posts: 61,667Questions: 1Answers: 10,096 Site admin

    I'm afraid I don't know why that would happen. My only guess is that there is something funny with the CSS. Right click on the element and select "Inspect" and that will show you the styles that are being applied to that cell.

    Allan

  • MapleThunderMapleThunder Posts: 4Questions: 2Answers: 0

    This is how the element gets generated. Does the sorting_disabled or sorting class change the text colour at all ?

    <th class="sorting_disabled" rowspan="1" colspan="1" aria-label="Calibration File">Calibration File</th>
    
  • allanallan Posts: 61,667Questions: 1Answers: 10,096 Site admin

    That entirely depends upon the CSS being used which is why I suggested checking that. The default DataTables CSS doesn't, but without a link to the page I can't say what is happening on your page.

    Allan

This discussion has been closed.