jQuery DataTables hide column without removing it from DOM

后端 未结 5 1911
囚心锁ツ
囚心锁ツ 2020-12-30 01:22

I need to hide a column from showing up in jquery datatables. When I hide the column using bVisible property it disappears from the DOM.

I want to set display proper

5条回答
  •  一向
    一向 (楼主)
    2020-12-30 01:42

    If you want to hide multiple columns:

    $('#example').dataTable({
      "columnDefs": [{ 
        "targets": [0,1,3], //Comma separated values
        "visible": false,
        "searchable": false }
      ]
    });
    

提交回复
热议问题