Disable sorting on first column with new constructor

Disable sorting on first column with new constructor

simotuxsimotux Posts: 19Questions: 4Answers: 1

Hello guys,

I'm using the new DataTable constructor (DataTable). I need to disable sorting on first columns of one my table, but i only found info about old constructor. How can i use disable sorting on new?

Thanks in advance!
Simone

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 61,903Questions: 1Answers: 10,148 Site admin
    Answer ✓

    Use order to change the default ordering for the table (since it is the first column by default) and columns.orderable to disable user ordering of the column.

    Allan

  • simotuxsimotux Posts: 19Questions: 4Answers: 1

    Even i use the new constructor?

  • allanallan Posts: 61,903Questions: 1Answers: 10,148 Site admin
    Answer ✓

    Yes. The $().dataTable() and $().DataTable() methods both accept exactly the same options. The only difference is the returned value.

    Allan

  • simotuxsimotux Posts: 19Questions: 4Answers: 1

    Okay! Thank you ;)

This discussion has been closed.