Disable automatic sorting on the first column when using jQuery DataTables

前端 未结 7 2162
遥遥无期
遥遥无期 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:43

    this.dtOptions = {
        order: [],
        columnDefs: [ {
            'targets': [0], /* column index [0,1,2,3]*/
            'orderable': false, /* true or false */
        }],
        ........ rest all stuff .....
    }
    

    The above worked fine for me.

    (I am using Angular version 7, angular-datatables version 6.0.0 and bootstrap version 4)

提交回复
热议问题