Disable automatic sorting on the first column when using jQuery DataTables

前端 未结 7 2164
遥遥无期
遥遥无期 2021-01-30 06:16

I\'m using jQuery DataTables and I would like to know if there\'s possible to disable automatic sorting on the first column of the table?

My code looks like this:

<
7条回答
  •  故里飘歌
    2021-01-30 06:57

    Set the aaSorting option to an empty array. It will disable initial sorting, whilst still allowing manual sorting when you click on a column.

    "aaSorting": []
    

    The aaSorting array should contain an array for each column to be sorted initially containing the column's index and a direction string ('asc' or 'desc').

提交回复
热议问题