bSortable false doesn't work for first column?

bSortable false doesn't work for first column?

mmarlettmmarlett Posts: 2Questions: 1Answers: 0
edited February 2018 in Free community support

In my config I have:
"aoColumnDefs": [ { "bSortable": false, "aTargets": [ 0 ] } ],

Yet that doesn't turn off the sorting for the first column. If I make aTargets 1, it will shut off sorting for the second column, as expected. There are seven columns, and if I set it to -6 it will shut off sorting the second column as well, but -7 does not stop the sorting on the first. The table it is working from is from the DOM. I'm at a loss.

Also, if I reorder the columns, I get the same behavior. That is, if I move what is now Actions[0] to Actions[1] and Name[1] to Name[0], then Name[0] is just as unresponsive as Actions[0] was. It isn't the content of the column causing this.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,303Questions: 26Answers: 4,947
    Answer ✓

    bSortable, AKA, columns.orderable is used to turn off the end users ability to order the column(s). By default Datatables orders column 0 ascending and displays the arrow indicating the order. You can use order if you want to change the default table ordering.

    Kevin

  • mmarlettmmarlett Posts: 2Questions: 1Answers: 0

    Thanks! That was the issue.

This discussion has been closed.