Set column to be ordered by id

Set column to be ordered by id

jbouv55151jbouv55151 Posts: 4Questions: 2Answers: 0
edited July 2016 in Free community support

Hello,
I am using datatables on my website, and to make it easier to use it on many pages, I always use the same javascript code.
So I would like to use id of column to set the default column to be ordered.
Example: if column has id="default_sort", the sorting is made on this column. If this id doesn't exist, by default on first column.

Is there a way to do that ?

Answers

  • allanallan Posts: 64,122Questions: 1Answers: 10,578 Site admin

    You would need to include the id in a column or in some orthogonal data that a sorting column can access.

    Allan

This discussion has been closed.