How to don't sort a separate column

How to don't sort a separate column

OlehKombaievOlehKombaiev Posts: 4Questions: 1Answers: 0
edited March 2017 in Free community support

Hello.

If I don't want to sort for example the third column in my table, I mean - please, look at the picture --

This question has accepted answers - jump to:

Answers

  • kthorngrenkthorngren Posts: 21,364Questions: 26Answers: 4,956
    Answer ✓

    You can use columns.orderable to disable the users ability to sort specific columns.

    Kevin

  • OlehKombaievOlehKombaiev Posts: 4Questions: 1Answers: 0

    Thanks! But If i have to disable the users ability to sort not only one specific columns.

  • F12MagicF12Magic Posts: 109Questions: 0Answers: 28
    Answer ✓

    Completely disable ordering can be done with ordering

  • OlehKombaievOlehKombaiev Posts: 4Questions: 1Answers: 0

    I have to disable ordering only for some columns, not for all

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    edited March 2017 Answer ✓

    That is precisely what Kevin has explained above.

  • OlehKombaievOlehKombaiev Posts: 4Questions: 1Answers: 0
    edited March 2017

    Thanks everyone: here is an answer:

    $('#table').DataTable( {
    "order": [[ 4, "asc" ]],
    "columnDefs": [
    { "orderable": false, "targets": 6 },
    { "orderable": false, "targets": 5 }
    ]
    } );

This discussion has been closed.